Add initial production

This commit is contained in:
2023-07-09 22:20:35 +04:00
parent 3ae88e6354
commit daa0357368
3 changed files with 372 additions and 0 deletions

41
docker-compose.yml Normal file
View File

@@ -0,0 +1,41 @@
version: '3'
networks:
main:
external: true
services:
backend:
image: node:lts-bookworm
container_name: backend
restart: unless-stopped
env_file: ./backend/.env.production
networks:
- main
ports:
- '18055:8055'
volumes:
- ./backend:/app
- ./data:/data
labels:
caddy: admin.pca-pijac.dev.civokram.com
caddy.reverse_proxy: '{{upstreams 18055}}'
command: sh -c "npm i -g pnpm && cd /app && pnpm install --production && pnpm run start"
frontend:
image: node:lts-bookworm
container_name: frontend
restart: unless-stopped
env_file: ./frontend/.env.production
depends_on:
- backend
networks:
- main
ports:
- '13000:3000'
volumes:
- ./frontend:/app
labels:
caddy: pca-pijac.dev.civokram.com
caddy.reverse_proxy: '{{upstreams 13000}}'
command: sh -c "npm i -g pnpm && cd /app && pnpm install --production && sleep 10 && pnpm run build && pnpm run start"