Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions app/compose/production/app_postgres/Dockerfile-compose
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM python:3.9.5

RUN echo POSTGRES
ENV APP_ROOT=/src
ENV CONFIG_ROOT=/config
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

RUN mkdir ${CONFIG_ROOT}
COPY requirements/base.txt ${CONFIG_ROOT}/base.txt
COPY requirements/production.txt ${CONFIG_ROOT}/production.txt


RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r ${CONFIG_ROOT}/production.txt
WORKDIR ${APP_ROOT}

ADD . ${APP_ROOT}

COPY ./djangoq_setup.sh /djangoq_setup.sh
RUN chmod +x /djangoq_setup.sh

RUN adduser appuser --system --no-create-home --shell /bin/sh \
&& chown -R appuser ${APP_ROOT}
USER appuser

CMD ["python", "manage.py", "collectstatic"]
3 changes: 2 additions & 1 deletion app/initial_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ python manage.py compilemessages
python manage.py makemigrations users projects dashboard && \
python manage.py migrate && \
python manage.py update_assettype && \
python /src/manage.py update_valuetype && \
python manage.py loaddata 'fixtures/multivector_fixture.json' && \
python manage.py collectstatic --no-input && \
echo 'Completed initial setup of open-plan GUI app successfully!!'
echo 'Completed initial setup of open-plan GUI app successfully!!'
2 changes: 1 addition & 1 deletion deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import warnings

LOGS = {"gui": "app", "server": "nginx", "queues": "djangoq"}
DB = "POSTGRES"
DB = "postgres"

parser = argparse.ArgumentParser(
prog="python deploy.py",
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
app_pg:
build:
context: ./app
dockerfile: ./compose/production/app_postgres/Dockerfile
dockerfile: ./compose/production/app_postgres/Dockerfile-compose
container_name: django-open_plan_pg
restart: always
env_file:
Expand All @@ -34,7 +34,7 @@ services:
djangoq_pg:
build:
context: ./app
dockerfile: ./compose/production/app_postgres/Dockerfile
dockerfile: ./compose/production/app_postgres/Dockerfile-compose
container_name: django-q-open_plan_pg
restart: always
env_file:
Expand Down