Skip to content

Commit

Permalink
chore(api/dockerfile): DRY expose
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Mar 27, 2024
1 parent 2210ec8 commit 9c02dd2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ENV GIT_ASKPASS=true \
DJANGO_SETTINGS_MODULE=outdated.settings \
PYTHONUNBUFFERED=1

EXPOSE 8000

FROM base AS build

WORKDIR /app
Expand Down Expand Up @@ -40,8 +42,6 @@ RUN poetry config virtualenvs.create false && poetry install

USER 1001

EXPOSE 8000

CMD ["sh", "-c", "wait4ports -s 15 tcp://db:5432 ; ./manage.py migrate && ./manage.py runserver 0.0.0.0:8000"]

FROM base as prod
Expand All @@ -54,6 +54,4 @@ RUN pip install /tmp/*.whl && rm /tmp/*.whl

USER 1001

EXPOSE 8000

CMD ["sh", "-c", "manage.py migrate && gunicorn --bind :8000 outdated.wsgi"]

0 comments on commit 9c02dd2

Please sign in to comment.