Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit b89eda9

Browse files
committed
feat(docker): local redis service
1 parent b6191ea commit b89eda9

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "caltrans/pems",
33
"dockerComposeFile": ["../compose.yml"],
44
"service": "dev",
5-
"runServices": ["dev", "pgweb"],
5+
"runServices": ["dev", "pgweb", "redis"],
66
"forwardPorts": ["docs:8000"],
77
"workspaceFolder": "/caltrans/app",
88
"postStartCommand": ["/bin/bash", "bin/setup.sh"],

.env.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ STREAMLIT_NAV=hidden
2727

2828
# AWS
2929
AWS_PROFILE=pems
30+
31+
# Redis
32+
REDIS_PORT=6379
33+
REDIS_HOSTNAME=redis

compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ services:
7575
ports:
7676
- "${STREAMLIT_LOCAL_PORT:-8501}:8501"
7777

78+
redis:
79+
image: redis:8
80+
ports:
81+
- "${REDIS_LOCAL_PORT:-6379}:6379"
82+
command: redis-server --save 60 1 --loglevel notice
83+
healthcheck:
84+
test: redis-cli ping | grep PONG
85+
interval: 1s
86+
timeout: 5s
87+
retries: 5
88+
volumes:
89+
- redisdata:/data
90+
7891
volumes:
7992
pgdata:
8093
driver: local
94+
redisdata:
95+
driver: local

0 commit comments

Comments
 (0)