-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f4e281
commit 4a7eec4
Showing
16 changed files
with
736 additions
and
637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# set up environment variables | ||
FROM python:3.9.16 | ||
|
||
ENV POETRY_VIRTUALENVS_CREATE false | ||
ENV POETRY_VERSION 1.3.1 | ||
ENV POETRY_HOME /opt/poetry | ||
ENV POETRY_NO_INTERACTION 1 | ||
ENV VIRTUAL_ENV /venv | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
ENV PATH $POETRY_HOME/bin:$PATH | ||
|
||
# set up dependencies, create virtual environment | ||
RUN mkdir -p /opt/csm_web | ||
WORKDIR /opt/csm_web | ||
|
||
# install poetry | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
# create and activate virtual environment for poetry | ||
RUN python3 -m venv $VIRTUAL_ENV | ||
ENV PATH $VIRTUAL_ENV/bin:$PATH | ||
|
||
# install python dependencies | ||
COPY poetry.lock pyproject.toml ./ | ||
RUN poetry install --no-root --with=dev | ||
|
||
# start database | ||
COPY ./docker-django-entrypoint.sh ./ | ||
ENTRYPOINT ["./docker-django-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM node:18 | ||
|
||
# install inotify-tools for webpack reloading | ||
# RUN apt install inotify-tools | ||
|
||
RUN mkdir -p /opt/csm_web \ | ||
# change ownership of /opt/csm_web to install dependencies | ||
&& chown node:node /opt/csm_web | ||
|
||
WORKDIR /opt/csm_web | ||
|
||
USER node | ||
|
||
# install npm dependencies | ||
COPY --chown=node:node package.json package-lock.json ./ | ||
RUN npm install && npm cache clean --force | ||
ENV PATH /opt/csm_web/node_modules/.bin:$PATH | ||
|
||
WORKDIR /opt/csm_web/app | ||
|
||
# change to root to allow permission changes in entrypoint | ||
USER root | ||
|
||
# specify entrypoint to execute pre-command tasks | ||
COPY ./docker-node-entrypoint.sh ./ | ||
ENTRYPOINT ["./docker-node-entrypoint.sh"] | ||
|
||
# start continuous compilation | ||
CMD ["npm", "run", "watch"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
services: | ||
postgres: | ||
image: postgres:14 | ||
healthcheck: | ||
test: /usr/bin/pg_isready | ||
interval: 5s | ||
timeout: 10s | ||
retries: 120 | ||
environment: | ||
POSTGRES_DB: csm_web_dev | ||
PGUSER: postgres | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
node: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.node | ||
volumes: | ||
# mount source files | ||
- type: bind | ||
source: ./ | ||
target: /opt/csm_web/app | ||
read_only: true | ||
# output from webpack | ||
- type: bind | ||
source: ./csm_web/frontend/static/frontend/ | ||
target: /opt/csm_web/app/csm_web/frontend/static/frontend/ | ||
# mount package files | ||
- type: bind | ||
source: ./package.json | ||
target: /opt/csm_web/package.json | ||
read_only: true | ||
- type: bind | ||
source: ./package-lock.json | ||
target: /opt/csm_web/package-lock.json | ||
read_only: true | ||
# prevent node modules from being overwritten on host | ||
- notused:/opt/csm_web/app/node_modules | ||
django: | ||
tty: true | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.django | ||
env_file: .env | ||
environment: | ||
POSTGRES_DB: csm_web_dev | ||
POSTGRES_USER: postgres | ||
POSTGRES_HOST: postgres | ||
ports: | ||
- 8000:8000 | ||
volumes: | ||
- type: bind | ||
source: ./ | ||
target: /opt/csm_web | ||
read_only: true | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
|
||
networks: | ||
default: | ||
name: csm_web_default | ||
|
||
# volume to exclude files from being mounted | ||
volumes: | ||
notused: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
python3 csm_web/manage.py migrate | ||
exec python3 csm_web/manage.py runserver 0.0.0.0:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
chmod -R a+w /opt/csm_web/app/csm_web/frontend/static/frontend/ | ||
exec runuser -u node "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.