-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
38 lines (29 loc) · 1.02 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
# `docker-compose up` spins it up
# `docker-compose build`
# `docker-compose up`
# `docker-compose down` brings it back down. adding -v will clear the volume.
# `docker container ls` shows you what containers you have open
# `docker exec -it <container name> sh` will open a shell inside the live container.
# psql -d postgres -U postgres
# \l - lists databases
# \c postgres - switches to postgres db.
# \dt - shows tables in databse
# db connection details:
# use `postgres://postgres@localhost:5432/postgres` as the connection string
# download a workbench online to view the db contents in a gui while you're working. here's one: https://www.pgadmin.org/
version: "3"
services:
db:
build: ./
container_name: "census_db"
# since this is a local db for testing, it's fine to keep passwords here.
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=root
- POSTGRES_DB=census
ports:
- "54320:5432"
volumes:
- census-data:/var/lib/postgresql/data
volumes:
census-data: