feat: Add Docker configuration for Laravel application, including services for portal, database, and cache with environment variables and entrypoint script enhancements.
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
version: '3.8'
|
||||
|
||||
# Standalone mode — requires: docker network create web
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
|
||||
services:
|
||||
portal:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
expose:
|
||||
- "8088"
|
||||
networks:
|
||||
- web
|
||||
environment:
|
||||
- APP_ENV=production
|
||||
- APP_URL=https://demo.portal.tgs.com.vn
|
||||
- DB_HOST=portal-db
|
||||
- DB_PORT=3306
|
||||
- DB_DATABASE=${DB_DATABASE:-portal}
|
||||
- DB_USERNAME=${DB_USERNAME:-portal}
|
||||
- DB_PASSWORD=${DB_PASSWORD}
|
||||
- REDIS_HOST=portal-cache
|
||||
- REDIS_PORT=6379
|
||||
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||
depends_on:
|
||||
- portal-db
|
||||
- portal-cache
|
||||
restart: unless-stopped
|
||||
|
||||
portal-db:
|
||||
image: mysql:8
|
||||
networks:
|
||||
- web
|
||||
environment:
|
||||
- MYSQL_DATABASE=${DB_DATABASE:-portal}
|
||||
- MYSQL_USER=${DB_USERNAME:-portal}
|
||||
- MYSQL_PASSWORD=${DB_PASSWORD}
|
||||
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
|
||||
volumes:
|
||||
- portal_mysql_data:/var/lib/mysql
|
||||
restart: unless-stopped
|
||||
|
||||
portal-cache:
|
||||
image: redis:alpine
|
||||
command: redis-server --requirepass ${REDIS_PASSWORD}
|
||||
networks:
|
||||
- web
|
||||
volumes:
|
||||
- portal_redis_data:/data
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
portal_mysql_data:
|
||||
portal_redis_data:
|
||||
Reference in New Issue
Block a user