Skip to content

Commit

Permalink
add description for docker setups
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusNeblung committed Apr 23, 2024
1 parent d954dc6 commit 71a9cc4
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 8 deletions.
6 changes: 3 additions & 3 deletions {{ cookiecutter.project_slug }}/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ FROM docker.io/debian:bookworm as final
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update &&\
apt-get install -y --no-install-recommends nodejs python3 python-is-python3 pipenv nginx gunicorn xz-utils supervisor
COPY docker/supervisord.conf /etc/supervisor/supervisord.conf
COPY docker/start_backend.sh docker/start_frontend.sh docker/start_nginx.sh /usr/local/bin/
COPY docker/prod/supervisord.conf /etc/supervisor/supervisord.conf
COPY docker/prod/start_backend.sh docker/prod/start_frontend.sh docker/prod/start_nginx.sh /usr/local/bin/
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

# install django server
Expand All @@ -32,7 +32,7 @@ ADD Pipfile Pipfile.lock ./
RUN pipenv install --system --deploy
ADD LICENSE README.md ./
ADD src/ ./src/
ADD docker/nginx.conf /etc/nginx/sites-enabled/default
ADD docker/prod/nginx.conf /etc/nginx/sites-enabled/default

# add built frontend sources
COPY --from=gui_build /usr/local/src/{{ cookiecutter.project_slug }}_gui/.output ./src/{{ cookiecutter.project_slug }}_gui/dist/
Expand Down
12 changes: 12 additions & 0 deletions {{ cookiecutter.project_slug }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@ The following variables are defined:
| `NUXT_PUBLIC_OPENID_ISSUER` | *mafiasi-identity* | no | The openid issuer which the frontend uses for authentication (should be the same as the one in configured for django) |

For the configuration of these variables in `dev` mode, see the configuration in [.env.dev](./.env.dev).

## Docker Setup

This project contains two different docker setup. One is for production, one for development.

### Production Setup

The Docker Setup for production consists of the `Dockerfile` in the root of this project. The required assets are in the `/docker/prod` directory.

### Development Setup

The Docker Setup for development is based on the `compose.yaml` in the root of this project. All Dockerfiles and other files required for this are in the `/docker/dev` directory.
6 changes: 3 additions & 3 deletions {{ cookiecutter.project_slug }}/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ services:
backend:
build:
context: ./
dockerfile: ./docker/backend/Dockerfile
dockerfile: ./docker/dev/backend/Dockerfile
volumes:
- ./:/app/backend
depends_on:
- database

frontend:
build: docker/frontend
build: docker/dev/frontend
volumes:
- ./src/{{ cookiecutter.project_slug }}_gui:/app/frontend

webserver:
build: docker/webserver
build: docker/dev/webserver
depends_on:
- backend
- frontend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ RUN pip3 install pipenv==v2022.4.20

RUN usermod -u 2009 -g 33 -d /app/backend www-data

ADD ./docker/backend/env.dev.local /app/config/.env.dev.local
ADD ./docker/dev/backend/env.dev.local /app/config/.env.dev.local

EXPOSE 8000

#USER www-data:www-data
ADD ./docker/backend/start.sh /usr/local/bin/start.sh
ADD ./docker/dev/backend/start.sh /usr/local/bin/start.sh
CMD ["bash", "/usr/local/bin/start.sh"]

0 comments on commit 71a9cc4

Please sign in to comment.