ops: track production docker-compose and update image tag to :production (#117)
Updated ~/container-data/sba-database/docker-compose.yml on akamai from :latest to :production tag (applied directly on server). Also adds docker-compose.prod.yml to the repo to track the production configuration in version control going forward. Closes #117 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
29f9875718
commit
88dede88a4
118
docker-compose.prod.yml
Normal file
118
docker-compose.prod.yml
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
nginx-proxy-manager_npm_network:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
api:
|
||||||
|
# build: .
|
||||||
|
image: manticorum67/major-domo-database:production
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: sba_db_api
|
||||||
|
volumes:
|
||||||
|
- ./storage:/usr/src/app/storage
|
||||||
|
- ./logs:/usr/src/app/logs
|
||||||
|
ports:
|
||||||
|
- 801:80
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
- nginx-proxy-manager_npm_network
|
||||||
|
environment:
|
||||||
|
- TESTING=False
|
||||||
|
- LOG_LEVEL=${LOG_LEVEL}
|
||||||
|
- API_TOKEN=${API_TOKEN}
|
||||||
|
- TZ=${TZ}
|
||||||
|
- DATABASE_TYPE=postgresql
|
||||||
|
- POSTGRES_HOST=sba_postgres
|
||||||
|
- POSTGRES_DB=${SBA_DATABASE}
|
||||||
|
- POSTGRES_USER=${SBA_DB_USER}
|
||||||
|
- POSTGRES_PASSWORD=${SBA_DB_USER_PASSWORD}
|
||||||
|
- WEB_WORKERS=4
|
||||||
|
- REDIS_HOST=sba_redis
|
||||||
|
- REDIS_PORT=6379
|
||||||
|
- REDIS_DB=0
|
||||||
|
- CACHE_ENABLED=False
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:17-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: sba_postgres
|
||||||
|
environment:
|
||||||
|
- POSTGRES_DB=${SBA_DATABASE}
|
||||||
|
- POSTGRES_USER=${SBA_DB_USER}
|
||||||
|
- POSTGRES_PASSWORD=${SBA_DB_USER_PASSWORD}
|
||||||
|
- TZ=${TZ}
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
- ./logs:/var/log/postgresql
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${SBA_DB_USER} -d ${SBA_DATABASE}"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: sba_redis
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
environment:
|
||||||
|
- TZ=${TZ}
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 30s
|
||||||
|
command: redis-server --appendonly yes
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
image: adminer:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: sba_adminer
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
environment:
|
||||||
|
- ADMINER_DEFAULT_SERVER=sba_postgres
|
||||||
|
- TZ=${TZ}
|
||||||
|
# - ADMINER_DESIGN=pepa-linha-dark
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
|
||||||
|
sync-prod:
|
||||||
|
image: alpine:latest
|
||||||
|
container_name: sba_sync_prod
|
||||||
|
volumes:
|
||||||
|
- ./scripts:/scripts
|
||||||
|
- /home/cal/.ssh:/tmp/ssh:ro
|
||||||
|
environment:
|
||||||
|
- SBA_DB_USER=${SBA_DB_USER}
|
||||||
|
- SBA_DATABASE=${SBA_DATABASE}
|
||||||
|
- SBA_DB_USER_PASSWORD=${SBA_DB_USER_PASSWORD}
|
||||||
|
command: >
|
||||||
|
sh -c "
|
||||||
|
cp -r /tmp/ssh /root/.ssh &&
|
||||||
|
chmod 700 /root/.ssh &&
|
||||||
|
chmod 600 /root/.ssh/* &&
|
||||||
|
chown -R root:root /root/.ssh &&
|
||||||
|
/scripts/sync_from_prod.sh
|
||||||
|
"
|
||||||
|
profiles: ["sync"]
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
redis_data:
|
||||||
Loading…
Reference in New Issue
Block a user