|
| 1 | +# docker-compose.override.yml file to launch a full instance of Read the Docs. |
| 2 | +# |
| 3 | +# Read the Docs' Core team is using docker-compose internally. |
| 4 | +# We do not offer support on this file and configuration at this point. |
| 5 | +# DO NOT USE DOCKER-COMPOSE SETUP FOR PRODUCTION OR CUSTOM INSTALLATION. |
| 6 | + |
| 7 | +# We create this network here to be able to use a static IP for NGINX. |
| 8 | +# This is needed because hitting `community.dev.readthedocs.io` from |
| 9 | +# any service will fail since it will resolve to 127.0.0.1, but |
| 10 | +# instead we need to hit NGINX's IP (this is used on Embed API from |
| 11 | +# -ext for example) Setting a static IP for NGINX, allow us to |
| 12 | +# override /etc/hosts with this IP. |
| 13 | +version: '3' |
| 14 | + |
| 15 | +networks: |
| 16 | + readthedocs: |
| 17 | + driver: bridge |
| 18 | + ipam: |
| 19 | + config: |
| 20 | + - subnet: 10.10.0.0/16 |
| 21 | + |
| 22 | +services: |
| 23 | + |
| 24 | + server: |
| 25 | + build: |
| 26 | + args: |
| 27 | + GITHUB_TOKEN: ${GITHUB_TOKEN:-} |
| 28 | + |
| 29 | + nginx: |
| 30 | + networks: |
| 31 | + readthedocs: |
| 32 | + ipv4_address: 10.10.0.100 |
| 33 | + |
| 34 | + proxito: |
| 35 | + image: community_server:latest |
| 36 | + volumes: |
| 37 | + - ${PWD}:/usr/src/app/checkouts/readthedocs.org |
| 38 | + - ${PWD}/dockerfiles/settings/proxito.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/proxito.py |
| 39 | + environment: |
| 40 | + - DJANGO_SETTINGS_MODULE=readthedocs.settings.proxito |
| 41 | + |
| 42 | + web: |
| 43 | + image: community_server:latest |
| 44 | + volumes: |
| 45 | + - ${PWD}:/usr/src/app/checkouts/readthedocs.org |
| 46 | + - ${PWD}/dockerfiles/settings/web.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/web.py |
| 47 | + environment: |
| 48 | + - DJANGO_SETTINGS_MODULE=readthedocs.settings.web |
| 49 | + - HOSTIP=${HOSTIP:-} |
| 50 | + extra_hosts: |
| 51 | + - "community.dev.readthedocs.io:10.10.0.100" |
| 52 | + |
| 53 | + celery: |
| 54 | + image: community_server:latest |
| 55 | + volumes: |
| 56 | + - ${PWD}:/usr/src/app/checkouts/readthedocs.org |
| 57 | + - ${PWD}/dockerfiles/settings/celery.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/celery.py |
| 58 | + environment: |
| 59 | + - DJANGO_SETTINGS_MODULE=readthedocs.settings.celery |
| 60 | + - CELERY_APP_NAME=readthedocs |
| 61 | + |
| 62 | + build: |
| 63 | + image: community_server:latest |
| 64 | + volumes: |
| 65 | + - ${PWD}:/usr/src/app/checkouts/readthedocs.org |
| 66 | + - ${PWD}/dockerfiles/settings/build.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/build.py |
| 67 | + environment: |
| 68 | + - DJANGO_SETTINGS_MODULE=readthedocs.settings.build |
| 69 | + - CELERY_APP_NAME=readthedocs |
| 70 | + |
| 71 | + storage: |
| 72 | + image: mcr.microsoft.com/azure-storage/azurite:latest |
| 73 | + volumes: |
| 74 | + - storage_data:/data |
| 75 | + ports: |
| 76 | + - "10000:10000" |
| 77 | + networks: |
| 78 | + readthedocs: |
| 79 | + command: ["azurite-blob", "--silent", "--blobPort", "10000", "--blobHost", "0.0.0.0", "--location", "/data"] |
| 80 | + |
| 81 | + azure-cli: |
| 82 | + image: microsoft/azure-cli |
| 83 | + volumes: |
| 84 | + - ${PWD}/common/dockerfiles/scripts/create-containers.sh:/usr/local/bin/create-containers.sh |
| 85 | + links: |
| 86 | + - storage |
| 87 | + depends_on: |
| 88 | + - storage |
| 89 | + networks: |
| 90 | + readthedocs: |
| 91 | + command: ["/usr/local/bin/create-containers.sh"] |
0 commit comments