Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·124 lines (108 loc) · 3.09 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
·124 lines (108 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env -S bash -x -c 'docker compose --file docker-compose.yml up --detach'
#region commands -----------------------------------------------------------------------------------
# 1. Create the containers and the services in the background
#$ docker compose --file docker-compose.yml up --detach
# 2. Test database connections
#$ docker exec -it petl-postgres psql -U petl --dbname=petl
#$ docker exec -it petl-msyql mysql --user=petl --database=petl --password=test
# 3. Stop the services and remove the containers
#$ docker compose --file docker-compose.yml down --remove-orphans -v --rmi local
#endregion -----------------------------------------------------------------------------------------
#region file/db services ---------------------------------------------------------------------------
---
services:
postgres:
container_name: petl-postgres
hostname: petl_postgres
image: postgres:latest
environment:
- POSTGRES_USER=petl
- POSTGRES_PASSWORD=test
- POSTGRES_DB=petl
- POSTGRES_HOST_AUTH_METHOD=password
ports:
- "5432:5432/tcp"
restart: "unless-stopped"
stdin_open: true
tty: true
healthcheck:
test:
[
"CMD",
"psql",
"--host=localhost",
"--username=petl",
"--dbname=petl",
"-c",
"select 1 as ok",
]
interval: 20s
timeout: 10s
retries: 5
start_period: 2s
networks:
- petl_network
mysql:
container_name: petl-mysql
hostname: petl_mysql
image: mysql:latest
ports:
- "3306:3306/tcp"
- "33060:33060/tcp"
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: "petl"
MYSQL_USER: "petl"
MYSQL_PASSWORD: "test"
MYSQL_ROOT_PASSWORD: "pass0"
restart: "unless-stopped"
stdin_open: true
tty: true
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 20s
timeout: 10s
retries: 5
start_period: 2s
networks:
- petl_network
samba:
container_name: petl-samba
hostname: petl_samba
image: dperson/samba
ports:
- "137:137/udp"
- "138:138/udp"
- "139:139/tcp"
- "445:445/tcp"
tmpfs:
- /tmp
restart: unless-stopped
stdin_open: true
tty: true
volumes:
- /mnt:/mnt:z
- /mnt2:/mnt2:z
command: '-s "public;/mnt;yes;no;yes;all" -s "mount2;/mnt2" -u "petl;test" -p'
networks:
- petl_network
sftp:
container_name: petl-sftp
hostname: petl_sftp
image: atmoz/sftp
ports:
- "2244:22/tcp"
tmpfs:
- /tmp
restart: unless-stopped
stdin_open: true
tty: true
command: "petl:test:::public"
networks:
- petl_network
#endregion -----------------------------------------------------------------------------------------
#region other settings -----------------------------------------------------------------------------
networks:
petl_network:
driver: bridge
#endregion -----------------------------------------------------------------------------------------