-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.docker-compose.yml
38 lines (36 loc) · 951 Bytes
/
ci.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
services:
app:
image: mcr.microsoft.com/devcontainers/go:1-1.22-bookworm
container_name: app
volumes:
- .:/workspace:cached
command: /bin/sh -c "cd /workspace/cmd/movie-api && go run main.go"
ports:
- 9000:9000
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9000/health > /proc/1/fd/1 2>/proc/1/fd/2 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
depends_on:
mariadb:
condition: service_healthy
mariadb:
image: mariadb:10.6
container_name: mariadb
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: moviesdb
MYSQL_USER: user
MYSQL_PASSWORD: password
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
volumes:
mysql-data: