Setup docker for production and development
Change ./init.sh to be an executable then run it. The default inner container ports are as followed: - Postgres: 5432:5432 - Backend: 3001:3000 - Frontend: 3000:3000 - Frontend dev: 8000 The backend image needs to be built: docker compose up -d --build
This commit is contained in:
@@ -1,10 +1,44 @@
|
||||
services:
|
||||
latosa-escrima:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
latosa-escrima.fr-frontend:
|
||||
container_name: latosa-frontend
|
||||
image: cems.dev:5000/latosa-escrima.fr:latest
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- 3000:${FRONTEND_PORT}
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- FRONTEND_PORT=${FRONTEND_PORT}
|
||||
restart: always # Ensures the container restarts on failure or Docker restart
|
||||
networks:
|
||||
- le-network
|
||||
latosa-escrima.fr-backend:
|
||||
container_name: latosa-backend
|
||||
build:
|
||||
context: ./backend/
|
||||
dockerfile: Dockerfile
|
||||
env_file: .env
|
||||
environment:
|
||||
- PORT="3001"
|
||||
ports:
|
||||
- "3001:${BACKEND_PORT}"
|
||||
networks:
|
||||
- le-network
|
||||
psql:
|
||||
container_name: latosa-database
|
||||
image: postgres:17.2-alpine
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- le-data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- le-network
|
||||
|
||||
volumes:
|
||||
le-data:
|
||||
|
||||
networks:
|
||||
le-network:
|
||||
|
||||
Reference in New Issue
Block a user