Update docker-compose.yml

This commit is contained in:
2025-10-24 22:30:50 +08:00
parent 233f3fe40e
commit 78310b8134

View File

@@ -1,11 +1,23 @@
services: networks:
tutorotp: tutorotp:
volumes:
postgres_data:
secrets:
postgres_password:
file: ./postgres_password.txt
services:
web:
build: . build: .
image: pinlin/tutorotp:latest image: pinlin/tutorotp:latest
networks:
- tutorotp
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=3000 - PORT=3000
- PGHOST= - PGHOST=postgres
- PGPORT=5432 - PGPORT=5432
- PGUSER=tutorotp - PGUSER=tutorotp
- PGPASSWORD= - PGPASSWORD=
@@ -15,4 +27,22 @@ services:
- CLIENT_ID= - CLIENT_ID=
- CLIENT_SECRET= - CLIENT_SECRET=
- COOKIE_SECRET= - COOKIE_SECRET=
ports:
- "3000:3000"
depends_on:
- postgres
restart: always restart: always
postgres:
image: postgres:16.4-alpine
restart: always
networks:
- tutorotp
volumes:
- postgres_data:/var/lib/postgresql/data/
secrets:
- postgres_password
environment:
POSTGRES_DB: tutorotp
POSTGRES_USER: tutorotp
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password