feat: working local setup!

This commit is contained in:
karishmas6
2024-11-01 16:03:48 +05:30
parent 9ca7c070c4
commit 1ff0fabe78

View File

@@ -1,31 +1,12 @@
version: '3.8' version: '3.8'
services: services:
app: postgres:
build:
context: .
dockerfile: Dockerfile
target: production
args:
VITE_BACKEND_URL: ${VITE_BACKEND_URL}
env_file: .env
ports:
- "5173:80" # Frontend exposed on port 5173
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://app:80/"] # Changed to port 80
interval: 10s
timeout: 5s
retries: 5
db:
image: postgres:13 image: postgres:13
environment: environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER} POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports: ports:
- "5432:5432" - "5432:5432"
volumes: volumes:
@@ -36,6 +17,16 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
redis:
image: redis:6
environment:
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
ports:
- "6379:6379"
volumes:
- redis_data:/data
minio: minio:
image: minio/minio image: minio/minio
environment: environment:
@@ -47,24 +38,27 @@ services:
volumes: volumes:
- minio_data:/data - minio_data:/data
redis: backend:
image: redis:6 build:
environment: context: .
- REDIS_HOST=redis dockerfile: server/Dockerfile
- REDIS_PORT=6379
ports: ports:
- "6379:6379" - "8080:8080"
volumes: env_file: .env
- redis_data:/data
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf # Your Nginx config
ports:
- "80:80" # Host port 80 mapped to Nginx port 80
depends_on: depends_on:
- app - postgres
- redis
- minio
frontend:
build:
context: .
dockerfile: Dockerfile
ports:
- "5173:5173"
env_file: .env
depends_on:
- backend
volumes: volumes:
postgres_data: postgres_data: