S
Supanote
Sign in Sign up

Docker Compose Production Web Stack

plain (yaml) 1 day ago · 47 lines · 11 views
1version: '3.8'
2
3services:
4 web:
5 build: .
6 restart: always
7 environment:
8 NODE_ENV: production
9 DATABASE_URL: ${DATABASE_URL}
10 REDIS_URL: ${REDIS_URL}
11 ports:
12 - "3000:3000"
13 depends_on:
14 - db
15 - redis
16 networks:
17 - internal
19 db:
20 image: postgres:16-alpine
21 restart: always
22 environment:
23 POSTGRES_USER: ${POSTGRES_USER}
24 POSTGRES_PASSWORD_FILE: /run/secrets/db_password
25 POSTGRES_DB: ${POSTGRES_DB}
26 volumes:
27 - pgdata:/var/lib/postgresql/data
28 networks:
29 - internal
31 redis:
32 image: redis:7-alpine
33 restart: always
34 command: redis-server --appendonly yes
35 volumes:
36 - redisdata:/data
37 networks:
38 - internal
40volumes:
41 pgdata:
42 redisdata:
44networks:
45 internal:
46 driver: bridge

No replies yet

Every reply is a note. Start a discussion, ask a question, or attach a code snippet.

Share Note

Download SVG
Social Card Preview
Open on mobile
Point your phone camera to open this note directly

Report this note

Notification