-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
58 lines (54 loc) · 1.53 KB
/
docker-compose.yml
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
version: "3.8"
services:
db:
image: mariadb
container_name: db
restart: always
environment:
MARIADB_DATABASE: ${DB_NAME:-planify}
MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-root}
volumes:
- ./api/database/01-tables.sql:/docker-entrypoint-initdb.d/migration.sql
- db_data:/var/lib/mysql
ports:
- "${DB_PORT:-3308}:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u${DB_USER:-root}", "-p${DB_ROOT_PASSWORD:-root}"]
interval: 5s
timeout: 3s
retries: 3
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
restart: always
environment:
PMA_HOST: ${DB_HOST:-db}
PMA_PORT: 3306
PMA_USER: ${DB_USER:-root}
PMA_PASSWORD: ${DB_PASSWORD:-root}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-root}
MYSQL_PASSWORD: ${DB_PASSWORD:-root}
ports:
- "${PHPMYADMIN_PORT:-8080}:80"
depends_on:
db:
condition: service_healthy
go-api:
build:
context: .
dockerfile: Dockerfile
restart: on-failure
environment:
DB_HOST: ${DB_HOST:-db}
DB_NAME: ${DB_NAME:-planify}
DB_USER: ${DB_USER:-root}
DB_PASSWORD: ${DB_PASSWORD:-root}
DB_PORT: 3306
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
volumes:
db_data:
driver: local