Skip to content

Commit 873b293

Browse files
committed
Docker: use dedicated db for telemetry
Ref readthedocs/readthedocs.org#9113
1 parent 47a56a4 commit 873b293

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

dockerfiles/docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ services:
143143
- POSTGRES_PASSWORD=docs_pwd
144144
- POSTGRES_DB=docs_db
145145
volumes:
146+
- ${PWD}/common/dockerfiles/entrypoints/postgres.sql:/docker-entrypoint-initdb.d/postgres.sql
146147
- postgres_data:/var/lib/postgresql/data
147148
- postgres_backups_data:/backups
148149
networks:

dockerfiles/entrypoints/postgres.sql

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- Initialization script.
2+
-- https://github.com/docker-library/docs/blob/master/postgres/README.md#initialization-scripts
3+
CREATE DATABASE telemetry;

dockerfiles/entrypoints/web.sh

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if [ -n "$INIT" ];
66
then
77
echo "Performing initial tasks..."
88
python3 manage.py migrate
9+
python3 manage.py migrate --database telemetry
910
cat ../../docker/createsuperuser.py | python3 manage.py shell
1011
bash ../../docker/createbuckets.sh
1112
python3 manage.py collectstatic --no-input

0 commit comments

Comments
 (0)