-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (40 loc) · 988 Bytes
/
docker-compose.yml
File metadata and controls
44 lines (40 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
version: '3.8'
services:
# Database container
db:
restart: always
image: postgres:14.2-alpine
container_name: db
ports:
- 5432:5432
networks:
- docker_network
environment:
NODE_ENV: production
POSTGRES_USER: postgres
POSTGRES_PASSWORD: docker
command: ['postgres', '-c', 'log_statement=all', '-c', 'log_destination=stderr']
volumes:
- dbvol:/var/lib/postgresql/data:delegated
# Application container
web-app:
image: node:16.13.0
container_name: web-app
# Install dependencies only when needed
environment:
NODE_ENV: production
NEXT_PUBLIC_ENV: production
DATABASE_URL: 'postgresql://postgres:docker@db:5432/todo-db?schema=public&connect_timeout=300'
NEXT_SHARP_PATH: /app/node_modules/sharp
build: .
ports:
- 3000:3000
networks:
- docker_network
depends_on:
- db
volumes:
dbvol:
networks:
docker_network:
name: docker_network