another aproach
This commit is contained in:
parent
f964255f1a
commit
adb2f0fa34
@ -6,78 +6,42 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
environment:
|
||||||
- NODE_ENV=${NODE_ENV}
|
- NODE_ENV=production
|
||||||
# - API_URL=${API_URL}
|
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?schema=public
|
||||||
# - CORS_ORIGIN=${CORS_ORIGIN}
|
- POSTGRES_USER=postgres
|
||||||
# - DATABASE_URL=${DATABASE_URL}
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
# - JWT_SECRET=${JWT_SECRET}
|
- POSTGRES_DB=${POSTGRES_DB}
|
||||||
# - SMTP_HOST=${SMTP_HOST}
|
|
||||||
# - SMTP_PORT=${SMTP_PORT}
|
|
||||||
# - SMTP_USER=${SMTP_USER}
|
|
||||||
# - SMTP_PASS=${SMTP_PASS}
|
|
||||||
# - EMAIL_FROM=${EMAIL_FROM}
|
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
|
||||||
- NODE_ENV=${NODE_ENV}
|
|
||||||
- API_URL=${API_URL}
|
|
||||||
- CORS_ORIGIN=${CORS_ORIGIN}
|
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
|
||||||
- JWT_SECRET=${JWT_SECRET}
|
|
||||||
- SMTP_HOST=${SMTP_HOST}
|
|
||||||
- SMTP_PORT=${SMTP_PORT}
|
|
||||||
- SMTP_USER=${SMTP_USER}
|
|
||||||
- SMTP_PASS=${SMTP_PASS}
|
|
||||||
- EMAIL_FROM=${EMAIL_FROM}
|
|
||||||
- CORS_ORIGINS=http://localhost:5173,https://www.placebo.mk,https://placebo.mk
|
|
||||||
- CORS_CREDENTIALS=true
|
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
networks:
|
||||||
- app_network
|
- imk_network
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
container_name: imk-postgres
|
container_name: imk-postgres
|
||||||
image: postgres:14-alpine
|
image: postgres:14-alpine
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
- POSTGRES_USER=postgres
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
- POSTGRES_DB=${POSTGRES_DB}
|
- POSTGRES_DB=${POSTGRES_DB}
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
networks:
|
networks:
|
||||||
- app_network
|
- imk_network
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
|
test: ["CMD-SHELL", "pg_isready -U postgres -d ${POSTGRES_DB}"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
redis:
|
|
||||||
container_name: imk-redis
|
|
||||||
image: redis:alpine
|
|
||||||
command: redis-server --requirepass ${REDIS_PASSWORD}
|
|
||||||
environment:
|
|
||||||
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
|
||||||
volumes:
|
|
||||||
- redis_data:/data
|
|
||||||
networks:
|
|
||||||
- app_network
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
app_network:
|
imk_network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
redis_data:
|
|
||||||
|
|||||||
@ -1,60 +0,0 @@
|
|||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
backend:
|
|
||||||
container_name: imk-backend
|
|
||||||
build:
|
|
||||||
context: ./backend
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
environment:
|
|
||||||
- NODE_ENV=production
|
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?schema=public
|
|
||||||
- POSTGRES_USER=postgres
|
|
||||||
- POSTGRES_PASSWORD=postgres
|
|
||||||
- POSTGRES_DB=imk_db
|
|
||||||
- JWT_SECRET=${JWT_SECRET}
|
|
||||||
- SMTP_HOST=${SMTP_HOST}
|
|
||||||
- SMTP_PORT=${SMTP_PORT}
|
|
||||||
- SMTP_USER=${SMTP_USER}
|
|
||||||
- SMTP_PASS=${SMTP_PASS}
|
|
||||||
- SMTP_FROM=${SMTP_FROM}
|
|
||||||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
|
|
||||||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
|
|
||||||
- AWS_REGION=${AWS_REGION}
|
|
||||||
- AWS_BUCKET_NAME=${AWS_BUCKET_NAME}
|
|
||||||
- AWS_ENDPOINT_URL=${AWS_ENDPOINT_URL}
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
depends_on:
|
|
||||||
postgres:
|
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
|
||||||
- imk_network
|
|
||||||
|
|
||||||
postgres:
|
|
||||||
container_name: imk-postgres
|
|
||||||
image: postgres:14-alpine
|
|
||||||
environment:
|
|
||||||
# - NODE_ENV=production
|
|
||||||
# - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?schema=public
|
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
||||||
- POSTGRES_DB=${POSTGRES_DB}
|
|
||||||
volumes:
|
|
||||||
- postgres_data:/var/lib/postgresql/data
|
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
networks:
|
|
||||||
- imk_network
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
networks:
|
|
||||||
imk_network:
|
|
||||||
driver: bridge
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres_data:
|
|
||||||
Loading…
Reference in New Issue
Block a user