updates
This commit is contained in:
98
docker-compose.yml
Normal file
98
docker-compose.yml
Normal file
@@ -0,0 +1,98 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: gnx-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB:-gnxdb}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-gnx}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-change-this-password}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- gnx-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-gnx}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backEnd
|
||||
dockerfile: Dockerfile
|
||||
container_name: gnx-backend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "1086:1086"
|
||||
env_file:
|
||||
- .env.production
|
||||
environment:
|
||||
- DEBUG=False
|
||||
- SECRET_KEY=${SECRET_KEY:-change-this-in-production}
|
||||
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-localhost,127.0.0.1,backend}
|
||||
- DATABASE_URL=${DATABASE_URL:-postgresql://${POSTGRES_USER:-gnx}:${POSTGRES_PASSWORD:-change-this-password}@postgres:5432/${POSTGRES_DB:-gnxdb}}
|
||||
- ADMIN_ALLOWED_IPS=${ADMIN_ALLOWED_IPS:-193.194.155.249}
|
||||
- INTERNAL_API_KEY=${INTERNAL_API_KEY}
|
||||
- EMAIL_BACKEND=${EMAIL_BACKEND:-django.core.mail.backends.console.EmailBackend}
|
||||
- EMAIL_HOST=${EMAIL_HOST}
|
||||
- EMAIL_PORT=${EMAIL_PORT:-587}
|
||||
- EMAIL_USE_TLS=${EMAIL_USE_TLS:-True}
|
||||
- EMAIL_HOST_USER=${EMAIL_HOST_USER}
|
||||
- EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}
|
||||
- DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL:-noreply@gnxsoft.com}
|
||||
- COMPANY_EMAIL=${COMPANY_EMAIL:-contact@gnxsoft.com}
|
||||
volumes:
|
||||
- ./backEnd/media:/app/media
|
||||
- ./backEnd/staticfiles:/app/staticfiles
|
||||
- ./backEnd/logs:/app/logs
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- gnx-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:1086/admin/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontEnd
|
||||
dockerfile: Dockerfile
|
||||
container_name: gnx-frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "1087:1087"
|
||||
env_file:
|
||||
- .env.production
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DOCKER_ENV=true
|
||||
- NEXT_PUBLIC_API_URL=http://backend:1086
|
||||
- PORT=1087
|
||||
depends_on:
|
||||
- backend
|
||||
networks:
|
||||
- gnx-network
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:1087/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
networks:
|
||||
gnx-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
media:
|
||||
staticfiles:
|
||||
|
||||
Reference in New Issue
Block a user