Update docker-compose.yml
This commit is contained in:
@@ -1,20 +1,41 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
db:
|
||||||
|
image: mysql:8.0
|
||||||
|
container_name: email_templates_db
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: rootpassword
|
||||||
|
MYSQL_DATABASE: email_templates
|
||||||
|
MYSQL_USER: appuser
|
||||||
|
MYSQL_PASSWORD: apppassword
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
volumes:
|
||||||
|
- db_data:/var/lib/mysql
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||||
|
timeout: 20s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
|
container_name: email_templates_app
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
# Database Connection Configuration
|
DB_HOST: db
|
||||||
# We removed the ':-default' syntax.
|
DB_USER: appuser
|
||||||
# Now, the container will strictly use what is provided by the host environment.
|
DB_PASSWORD: apppassword
|
||||||
- DB_TYPE=${DB_TYPE}
|
DB_NAME: email_templates
|
||||||
- DB_HOST=${DB_HOST}
|
DB_PORT: 3306
|
||||||
- DB_PORT=${DB_PORT}
|
DB_TYPE: mysql
|
||||||
- DB_USER=${DB_USER}
|
API_KEY: ${API_KEY}
|
||||||
- DB_PASSWORD=${DB_PASSWORD}
|
depends_on:
|
||||||
- DB_NAME=${DB_NAME}
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
# Application Keys
|
volumes:
|
||||||
- API_KEY=${API_KEY}
|
db_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user