77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.backend
|
|
container_name: admintemplate-backend
|
|
restart: unless-stopped
|
|
environment:
|
|
- SERVER_PORT=8080
|
|
- SERVER_HOST=0.0.0.0
|
|
- ENV=production
|
|
- DB_TYPE=sqlite
|
|
- SQLITE_PATH=/app/data/admintemplate.db
|
|
- JWT_SECRET=${JWT_SECRET:-change-this-secret-in-production}
|
|
- TOKEN_DURATION=24
|
|
volumes:
|
|
- backend-data:/app/data
|
|
networks:
|
|
- admintemplate-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
frontend:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.frontend
|
|
container_name: admintemplate-frontend
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- admintemplate-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Optional: MariaDB for production use
|
|
# Uncomment and set DB_TYPE=mysql in backend environment
|
|
# mariadb:
|
|
# image: mariadb:11
|
|
# container_name: admintemplate-db
|
|
# restart: unless-stopped
|
|
# environment:
|
|
# - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-rootpassword}
|
|
# - MYSQL_DATABASE=admintemplate
|
|
# - MYSQL_USER=adminuser
|
|
# - MYSQL_PASSWORD=${DB_PASSWORD:-adminpassword}
|
|
# volumes:
|
|
# - mariadb-data:/var/lib/mysql
|
|
# networks:
|
|
# - admintemplate-network
|
|
# healthcheck:
|
|
# test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
# interval: 30s
|
|
# timeout: 10s
|
|
# retries: 3
|
|
|
|
volumes:
|
|
backend-data:
|
|
driver: local
|
|
# mariadb-data:
|
|
# driver: local
|
|
|
|
networks:
|
|
admintemplate-network:
|
|
driver: bridge
|