forked from jmug/cactoide
feat: add Github Action to build the image
This commit is contained in:
59
docker-compose.prod.yml
Normal file
59
docker-compose.prod.yml
Normal file
@@ -0,0 +1,59 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Database
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: cactoide-db-prod
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-cactoied_database}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-cactoide}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-cactoide_password}
|
||||
ports:
|
||||
- '5432:5432'
|
||||
volumes:
|
||||
- postgres_data_prod:/var/lib/postgresql/data
|
||||
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
'CMD-SHELL',
|
||||
'pg_isready -U ${POSTGRES_USER:-cactoide} -d ${POSTGRES_DB:-cactoied_database}'
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- cactoide-network-prod
|
||||
restart: unless-stopped
|
||||
|
||||
# Application
|
||||
app:
|
||||
image: ghcr.io/polaroi8d/cactoide:latest
|
||||
container_name: cactoide-app-prod
|
||||
ports:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
DATABASE_URL: postgres://${POSTGRES_USER:-cactoide}:${POSTGRES_PASSWORD:-cactoide_password}@postgres:5432/${POSTGRES_DB:-cactoied_database}
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
HOSTNAME: 0.0.0.0
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- cactoide-network-prod
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3000/']
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
volumes:
|
||||
postgres_data_prod:
|
||||
|
||||
networks:
|
||||
cactoide-network-prod:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user