-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.override.yml
44 lines (39 loc) · 1.17 KB
/
docker-compose.override.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
---
# This docker-compose file is required to bind ports and volumes for local development
# and is automatically loaded when running a docker-compose command without passing
# specific files with the `-f` flag.
version: '3.7'
services:
postgres:
image: postgres:11
restart: unless-stopped
networks:
- localnet
env_file: .env
ports:
# Adding 127.0.0.1 ensures that we only listen to local requests
- '127.0.0.1:5432:5432'
volumes:
- pgdata:/var/lib/postgresql/data
api:
build:
target: development_build
args:
ENV: local
init: true
depends_on:
- postgres
networks:
- localnet
ports:
# We only bind ports directly in development; need to listen to remote requests to allow local network access
- '8000:8000'
volumes:
# We only mount source code in development:
- .:/code
command: python -m uvicorn api:app --reload --host 0.0.0.0 --port 8000
networks:
# Network for local internals
localnet:
volumes:
pgdata: