refactor: remove embedded MySQL from docker-compose, use external data source
This commit is contained in:
+6
-25
@@ -1,38 +1,19 @@
|
|||||||
services:
|
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:
|
pr-helper:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- pr-helper-data:/app/data
|
- pr-helper-data:/app/data
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- GIN_MODE=release
|
- GIN_MODE=release
|
||||||
- MYSQL_HOST=mysql
|
# MYSQL_HOST in .env should point to your external MySQL
|
||||||
- MYSQL_PORT=3306
|
# Use host.docker.internal to reach the host machine from inside Docker
|
||||||
- MYSQL_USER=root
|
extra_hosts:
|
||||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-pr_helper_pass}
|
- "host.docker.internal:host-gateway"
|
||||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-pr_helper}
|
|
||||||
depends_on:
|
|
||||||
mysql:
|
|
||||||
condition: service_healthy
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql-data:
|
|
||||||
pr-helper-data:
|
pr-helper-data:
|
||||||
|
|||||||
Reference in New Issue
Block a user