Skip to content

Commit c4be152

Browse files
Local docker compose environment for shadow db + dev pg db.
1 parent ee2faac commit c4be152

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docker-compose.local.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file is ONLY for running the database on your local machine
2+
# for development tasks like running migrations.
3+
4+
services:
5+
db:
6+
image: postgres:15-alpine
7+
# We use the same container name as production for consistency.
8+
container_name: codebuilder-postgres-db
9+
restart: unless-stopped
10+
env_file:
11+
- ./.env
12+
ports:
13+
# This maps your local machine's port 5434 to the container's port 5432.
14+
# You can connect to this from your local machine if needed.
15+
- "5434:5432"
16+
volumes:
17+
# Persists data in a local volume named 'postgres-data-local'
18+
- postgres-data-local:/var/lib/postgresql/data
19+
networks:
20+
# Connects to the same network so your app can find it at 'db:5432'
21+
- codebuilder-net
22+
23+
volumes:
24+
postgres-data-local:
25+
26+
networks:
27+
codebuilder-net:
28+
name: codebuilder-net

0 commit comments

Comments
 (0)