Cập nhật cấu hình môi trường production và development
- Thêm file .env.prod với cấu hình chi tiết cho môi trường production - Cập nhật docker-compose.dev.yml và docker-compose.prod.yml - Tạo Dockerfile.prod với cấu hình chi tiết cho production - Bổ sung cấu hình nginx, prometheus, grafana - Thêm cấu hình backup và monitoring - Cập nhật README với hướng dẫn chi tiết
This commit is contained in:
@@ -7,13 +7,22 @@ services:
|
||||
ports:
|
||||
- ${PORT}:${PORT}
|
||||
environment:
|
||||
APP_ENV: local
|
||||
APP_ENV: ${APP_ENV}
|
||||
PORT: ${PORT}
|
||||
BLUEPRINT_DB_HOST: ${BLUEPRINT_DB_HOST}
|
||||
BLUEPRINT_DB_HOST: mysql_bp
|
||||
BLUEPRINT_DB_PORT: ${BLUEPRINT_DB_PORT}
|
||||
BLUEPRINT_DB_DATABASE: ${BLUEPRINT_DB_DATABASE}
|
||||
BLUEPRINT_DB_USERNAME: ${BLUEPRINT_DB_USERNAME}
|
||||
BLUEPRINT_DB_PASSWORD: ${BLUEPRINT_DB_PASSWORD}
|
||||
BLUEPRINT_DB_MAX_IDLE_CONNS: ${BLUEPRINT_DB_MAX_IDLE_CONNS}
|
||||
BLUEPRINT_DB_MAX_OPEN_CONNS: ${BLUEPRINT_DB_MAX_OPEN_CONNS}
|
||||
BLUEPRINT_DB_CONN_MAX_LIFETIME: ${BLUEPRINT_DB_CONN_MAX_LIFETIME}
|
||||
LOGGER_LOG_LEVEL: ${LOGGER_LOG_LEVEL}
|
||||
LOGGER_FILE_LOG_NAME: ${LOGGER_FILE_LOG_NAME}
|
||||
LOGGER_MAX_SIZE: ${LOGGER_MAX_SIZE}
|
||||
LOGGER_MAX_BACKUPS: ${LOGGER_MAX_BACKUPS}
|
||||
LOGGER_MAX_AGE: ${LOGGER_MAX_AGE}
|
||||
LOGGER_COMPRESS: ${LOGGER_COMPRESS}
|
||||
volumes:
|
||||
- .:/app # Mount current directory to /app in container
|
||||
command: air # Use air for hot-reload
|
||||
@@ -24,6 +33,7 @@ services:
|
||||
- blueprint
|
||||
mysql_bp:
|
||||
image: mysql:latest
|
||||
platform: linux/arm64
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_DATABASE: ${BLUEPRINT_DB_DATABASE}
|
||||
@@ -35,11 +45,26 @@ services:
|
||||
volumes:
|
||||
- mysql_volume_bp:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "${BLUEPRINT_DB_HOST}", "-u", "${BLUEPRINT_DB_USERNAME}", "--password=${BLUEPRINT_DB_PASSWORD}"]
|
||||
interval: 5s
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "${BLUEPRINT_DB_USERNAME}", "--password=${BLUEPRINT_DB_PASSWORD}", "--silent"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
retries: 5
|
||||
start_period: 40s
|
||||
networks:
|
||||
- blueprint
|
||||
|
||||
phpmyadmin:
|
||||
image: arm64v8/phpmyadmin:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8081:80"
|
||||
environment:
|
||||
PMA_HOST: mysql_bp
|
||||
PMA_PORT: 3306
|
||||
MYSQL_ROOT_PASSWORD: ${BLUEPRINT_DB_ROOT_PASSWORD}
|
||||
depends_on:
|
||||
mysql_bp:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- blueprint
|
||||
|
||||
|
||||
Reference in New Issue
Block a user