log101-dot-dev-services/docker-compose.yml

33 lines
596 B
YAML
Raw Normal View History

2024-05-30 09:52:18 +00:00
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: