-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
31 lines (31 loc) · 960 Bytes
/
docker-compose.yml
File metadata and controls
31 lines (31 loc) · 960 Bytes
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
services:
postgres:
image: postgres:15-alpine
container_name: tweet-api-postgres
environment:
# These credentials should match your application's config
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: tweet_db
ports:
# Exposes the database on port 5432 of your local machine
- "5432:5432"
volumes:
# This line runs the init.sql script when the container is first created
- ./db/init:/docker-entrypoint-initdb.d
# This line persists the database data on your local machine
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: tweet-api-redis
ports:
# Exposes Redis on port 6379 of your local machine
- "6379:6379"
volumes:
# This line persists Redis data on your local machine
- redis_data:/data
restart: unless-stopped
volumes:
postgres_data:
redis_data: