log101-dot-dev-services/docker-compose.yml
2024-05-30 12:52:18 +03:00

33 lines
596 B
YAML

version: '3.8'
services:
web:
build:
dockerfile: docker/go/Dockerfile
container_name: go_gin_app
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
env_file:
- .env
db:
image: mysql:8.0
container_name: mysql_db
restart: always
volumes:
- db_data:/var/lib/mysql
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql
env_file:
- .env
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 2s
timeout: 20s
retries: 10
volumes:
db_data: