Skip to content

Commit

Permalink
Consolidated docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
mfosterw committed Apr 13, 2024
1 parent 80ad503 commit 450e5d5
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 100 deletions.
7 changes: 2 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ Open a terminal at the project root and run the following for to activate all se

$ docker compose -f docker-compose.local.yml up

The site should start and be accessible at http://localhost:3000, with the api visible at http://localhost:8000/api.
The site should start and be accessible at http://localhost:3000, with the api visible
at http://localhost:8000/api/ and the documentation at http://localhost:9000.

You can also set the environment variable ``COMPOSE_FILE`` pointing to ``docker-compose.local.yml`` like this::

Expand All @@ -119,10 +120,6 @@ To run in a detached (background) mode, just::

$ docker compose up -d

These commands don't run the docs service. In order to run docs service you can run::

$ docker compose -f docker-compose.docs.yml up


Execute Management Commands
---------------------------
Expand Down
6 changes: 6 additions & 0 deletions compose/local/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ RUN groupadd --gid 1000 dev-user \

# Install required system dependencies
RUN apt-get update && apt-get install --no-install-recommends -y \
# To run the Makefile for docs
make \
# psycopg dependencies
libpq-dev \
# Translations dependencies
Expand Down Expand Up @@ -74,6 +76,10 @@ RUN sed -i 's/\r$//g' /start
RUN chmod +x /start


COPY ./compose/local/django/start-docs /start-docs
RUN sed -i 's/\r$//g' /start-docs
RUN chmod +x /start-docs

COPY ./compose/local/django/celery/worker/start /start-celeryworker
RUN sed -i 's/\r$//g' /start-celeryworker
RUN chmod +x /start-celeryworker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set -o errexit
set -o pipefail
set -o nounset

cd docs/
exec make livehtml
62 changes: 0 additions & 62 deletions compose/local/docs/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions docker-compose.docs.yml

This file was deleted.

27 changes: 14 additions & 13 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ volumes:
democrasite_local_postgres_data_backups: {}

services:
django:
django: &django
build:
context: .
dockerfile: ./compose/local/django/Dockerfile
Expand Down Expand Up @@ -38,35 +38,36 @@ services:
env_file:
- ./.envs/.local/.postgres

docs:
<<: *django
image: democrasite_local_docs
container_name: democrasite-local-docs
volumes:
- .:/app:z
ports:
- "9000:9000"
command: /start-docs
healthcheck: {}

redis:
image: docker.io/redis:6
container_name: democrasite-local-redis

celeryworker: &celery
build:
context: .
dockerfile: ./compose/local/django/Dockerfile
<<: *django
image: democrasite_local_celeryworker
container_name: democrasite-local-celeryworker
depends_on:
- redis
- postgres
volumes:
- .:/app:z
env_file:
- ./.envs/.local/.django
- ./.envs/.local/.postgres
ports: []
command: /start-celeryworker
healthcheck: {}

celerybeat:
<<: *celery
image: democrasite_local_celerybeat
container_name: democrasite-local-celerybeat
depends_on:
- redis
- postgres
ports: []
command: /start-celerybeat

flower:
Expand Down
Empty file removed docs/CONTRIBUTING.rst
Empty file.
1 change: 1 addition & 0 deletions docs/CONTRIBUTING.rst
Empty file removed docs/README.rst
Empty file.
1 change: 1 addition & 0 deletions docs/README.rst

0 comments on commit 450e5d5

Please sign in to comment.