Improved Application/DB
This commit is contained in:
@@ -1,8 +1,37 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
container_name: demo-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASS}
|
||||
POSTGRES_DB: ${DB_NAME}
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
image: demo-app:latest
|
||||
container_name: demo-app
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- DB_USER=${DB_USER}
|
||||
- DB_PASS=${DB_PASS}
|
||||
- DB_NAME=${DB_NAME}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "http://localhost:5000"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
nginx:
|
||||
image: jonasal/nginx-certbot:latest
|
||||
container_name: demo-nginx
|
||||
@@ -12,14 +41,25 @@ services:
|
||||
- 4433:443
|
||||
environment:
|
||||
- CERTBOT_EMAIL=the.dark.mist23@gmail.com
|
||||
- ENVSUBST_TEMPLATE_SUFFIX=.tmpl # Enables template processing if needed
|
||||
- CERTBOT_DISABLED=true # Disable auto Certbot to use manual certs
|
||||
- ENVSUBST_TEMPLATE_SUFFIX=.tmpl
|
||||
- CERTBOT_DISABLED=true
|
||||
volumes:
|
||||
- ./nginx_user_conf.d:/etc/nginx/conf.d/
|
||||
- letsencrypt:/etc/letsencrypt
|
||||
- /home/devroot/demo/certs/fullchain.pem:/etc/nginx/ssl/origin_cert.pem:ro # Mount cert
|
||||
- /home/devroot/demo/certs/prvkey.pem:/etc/nginx/ssl/origin_key.key:ro # Mount key
|
||||
- /home/devroot/demo/certs/fullchain.pem:/etc/nginx/ssl/origin_cert.pem:ro
|
||||
- /home/devroot/demo/certs/prvkey.pem:/etc/nginx/ssl/origin_key.key:ro
|
||||
depends_on:
|
||||
- app
|
||||
app:
|
||||
condition: service_healthy
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
letsencrypt:
|
||||
db-data:
|
||||
|
||||
Reference in New Issue
Block a user