Skip to content

Commit b113ebc

Browse files
committed
production config
1 parent 432d150 commit b113ebc

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

docker-compose.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ services:
7171
- SERVER_CONFIG=${SERVER_CONFIG}
7272
- RUNESTONE_HOST=${RUNESTONE_HOST}
7373
- RUNESTONE_PATH=/usr/src/app
74-
- REDIS_URI=redis://redis:6379/0
74+
- REDIS_URI=redis://${REDIS_HOST}:6379/0
7575
# Note: host.docker.internal refers back to the host so we can just use a local instance
7676
# of postgresql
7777
- DEV_DBURL=${DC_DEV_DBURL:-$DEV_DBURL}
@@ -84,7 +84,9 @@ services:
8484
- UVICORN_MAX_REQUESTS=5000
8585
- UVICORN_MAX_REQUESTS_JITTER=30
8686
- UVICORN_TIMEOUT=60
87-
87+
- LOGIN_URL="/runestone/default/user"
88+
- WORKER_NAME=${HOSTNAME}
89+
8890
links:
8991
- redis
9092
- jobe
@@ -110,7 +112,7 @@ services:
110112
- WEB2PY_CONFIG=${SERVER_CONFIG}
111113
- RUNESTONE_HOST=${RUNESTONE_HOST}
112114
- RUNESTONE_PATH=/usr/src/app
113-
- REDIS_URI=redis://redis:6379/0
115+
- REDIS_URI=redis://${REDIS_HOST}:6379/0
114116
# Note: host.docker.internal refers back to the host so we can just use a local instance
115117
# of postgresql
116118
- DEV_DBURL=${DC_DEV_DBURL:-$DEV_DBURL}
@@ -146,7 +148,7 @@ services:
146148
- BOOK_PATH=/usr/books
147149
- SERVER_CONFIG=${SERVER_CONFIG}
148150
- RUNESTONE_PATH=/usr/src/app
149-
- REDIS_URI=redis://redis:6379/0
151+
- REDIS_URI=redis://${REDIS_HOST}:6379/0
150152
# Note: host.docker.internal refers back to the host so we can just use a local instance
151153
# of postgresql
152154
- DEV_DBURL=${DC_DEV_DBURL:-$DEV_DBURL}

sample.env

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ DC_DBURL = postgresql://runestone:[email protected]/runestone
1919
DEV_DBURL = postgresql://runestone:runestone@localhost/runestone_dev
2020
DC_DEV_DBURL = postgresql://runestone:[email protected]/runestone_dev
2121

22+
# for single configurations it is fine to use the redis configured in docker-compose
23+
# however, for load balanced configurations you want to run a redis server that is
24+
# shared by all the workers.
25+
REDIS_HOST = redis
26+
2227
# Server configuration (production, development, or test)
2328
# You should not set these to test as that is for our testing framework, not for
2429
# people who are just testing out Runestone.
@@ -49,4 +54,5 @@ LOAD_BALANCER_HOST = localhost
4954
# for gunicorn we can add additional runtime parameters with the GUNICORN_CMD_ARGS variable
5055
# for uvicorn in production recommend 2 * cores + 1
5156
UVICORN_WORKERS=21
52-
GUNICORN_CMD_ARGS="--workers=3"
57+
GUNICORN_CMD_ARGS="--workers=3"
58+

0 commit comments

Comments
 (0)