|
1 | 1 | version: '3.8' |
2 | 2 |
|
3 | 3 | services: |
4 | | - app: |
5 | | - build: |
6 | | - context: .. |
7 | | - dockerfile: .devcontainer/Dockerfile |
8 | | - |
9 | | - volumes: |
10 | | - - ../..:/workspaces:cached |
11 | | - |
12 | | - # Overrides default command so things don't shut down after the process ends. |
13 | | - command: sleep infinity |
14 | | - |
15 | | - environment: |
16 | | - - NODE_ENV=development |
17 | | - - DATABASE_URL=postgresql://postgres:postgres@db:5432/teaching_api?schema=public |
18 | | - - PORT=3002 |
19 | | - |
20 | | - # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. |
21 | | - network_mode: service:db |
22 | | - |
23 | | - depends_on: |
24 | | - - db |
25 | | - |
26 | | - # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. |
27 | | - # (Adding the "ports" property to this file will not forward from a Codespace.) |
28 | | - |
29 | | - db: |
30 | | - image: postgres:17.2 |
31 | | - restart: unless-stopped |
32 | | - volumes: |
33 | | - - postgres-data:/var/lib/postgresql/data |
34 | | - environment: |
35 | | - POSTGRES_PASSWORD: postgres |
36 | | - POSTGRES_USER: postgres |
37 | | - POSTGRES_DB: teaching_api |
38 | | - ports: |
39 | | - - "3002:3002" |
40 | | - - "5432:5432" |
41 | | - |
42 | | - # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. |
43 | | - # (Adding the "ports" property to this file will not forward from a Codespace.) |
| 4 | + app: |
| 5 | + build: |
| 6 | + context: .. |
| 7 | + dockerfile: .devcontainer/Dockerfile |
| 8 | + |
| 9 | + volumes: |
| 10 | + - ../..:/workspaces:cached |
| 11 | + |
| 12 | + # Overrides default command so things don't shut down after the process ends. |
| 13 | + command: sleep infinity |
| 14 | + |
| 15 | + environment: |
| 16 | + - NODE_ENV=development |
| 17 | + - DATABASE_URL=postgresql://postgres:postgres@db:5432/teaching_api?schema=public |
| 18 | + - PORT=3002 |
| 19 | + |
| 20 | + # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. |
| 21 | + network_mode: service:db |
| 22 | + |
| 23 | + depends_on: |
| 24 | + - db |
| 25 | + |
| 26 | + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. |
| 27 | + # (Adding the "ports" property to this file will not forward from a Codespace.) |
| 28 | + |
| 29 | + db: |
| 30 | + image: postgres:17.2 |
| 31 | + restart: unless-stopped |
| 32 | + volumes: |
| 33 | + - postgres-data:/var/lib/postgresql/data |
| 34 | + environment: |
| 35 | + POSTGRES_PASSWORD: postgres |
| 36 | + POSTGRES_USER: postgres |
| 37 | + POSTGRES_DB: teaching_api |
| 38 | + ports: |
| 39 | + - '3002:3002' |
| 40 | + - '5432:5432' |
| 41 | + |
| 42 | + # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. |
| 43 | + # (Adding the "ports" property to this file will not forward from a Codespace.) |
44 | 44 |
|
45 | 45 | volumes: |
46 | | - postgres-data: |
| 46 | + postgres-data: |
0 commit comments