refactor: remove embedded MySQL from docker-compose, use external data source
This commit is contained in:
+6
-25
@@ -1,38 +1,19 @@
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD:-pr_helper_pass}
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-pr_helper}
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
pr-helper:
|
||||
build: .
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- pr-helper-data:/app/data
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- GIN_MODE=release
|
||||
- MYSQL_HOST=mysql
|
||||
- MYSQL_PORT=3306
|
||||
- MYSQL_USER=root
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-pr_helper_pass}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-pr_helper}
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
# MYSQL_HOST in .env should point to your external MySQL
|
||||
# Use host.docker.internal to reach the host machine from inside Docker
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
mysql-data:
|
||||
pr-helper-data:
|
||||
|
||||
Reference in New Issue
Block a user