forked from try-keep/setup-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
47 lines (44 loc) · 1.06 KB
/
docker-compose.yml
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
45
46
47
version: '3'
services:
db:
image: postgres:latest
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
expose:
- 5440
ports:
# Expose weird port on host to avoid collisions
- 5440:5432
volumes:
- dbdata:/var/lib/postgresql/data
restart: always
app:
image: node:16
command: sh -c "yarn install && PORT=5003 yarn dev"
volumes:
- ./components:/app/components
- ./db:/app/db
- ./next-env.d.ts:/app/next-env.d.ts
- ./package.json:/app/package.json
- ./pages:/app/pages
- ./tsconfig.json:/app/tsconfig.json
- ./types:/app/types
- ./utils:/app/utils
- ./yarn.lock:/app/yarn.lock
- cache:/usr/local/share/.cache/yarn/v6
- node_modules:/app/node_modules
ports:
# Weird port to avoid collisions
- 5003:5003
depends_on:
- db
environment:
DB_URL: postgres://postgres:postgres@db:5432/postgres
working_dir: /app
restart: always
volumes:
dbdata:
node_modules:
cache: