This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
15 changed files
with
87 additions
and
151 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
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 |
---|---|---|
@@ -1,20 +1,17 @@ | ||
name: Push main | ||
name: Pull request main | ||
|
||
on: | ||
push: | ||
pull_request_target: | ||
branches: [main] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
lint: | ||
uses: ./.github/workflows/lint.yml | ||
with: | ||
ref: ${{ github.ref }} | ||
ref: ${{ github.ref }} | ||
secrets: inherit | ||
test: | ||
uses: ./.github/workflows/test.yml | ||
uses: ./.github/workflows/tests.yml | ||
with: | ||
ref: ${{ github.ref }} | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
secrets: inherit |
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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
name: Pull request main | ||
name: Push main | ||
|
||
on: | ||
pull_request_target: | ||
push: | ||
branches: [main] | ||
paths-ignore: [ "docs/**" ] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
lint: | ||
uses: ./.github/workflows/lint.yml | ||
with: | ||
ref: ${{ github.ref }} | ||
secrets: inherit | ||
ref: ${{ github.ref }} | ||
test: | ||
uses: ./.github/workflows/tests.yml | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
ref: ${{ github.ref }} | ||
secrets: inherit |
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 |
---|---|---|
@@ -1,96 +1,30 @@ | ||
|
||
# define an alias for the specific python version used in this file. | ||
FROM python:3.11.6-slim-bullseye as python | ||
|
||
# Python build stage | ||
FROM python as python-build-stage | ||
|
||
ARG BUILD_ENVIRONMENT=production | ||
|
||
# Install apt packages | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
# dependencies for building Python packages | ||
build-essential \ | ||
# psycopg2 dependencies | ||
libpq-dev | ||
|
||
# Requirements are installed here to ensure they will be cached. | ||
COPY ./requirements . | ||
|
||
# Create Python Dependency and Sub-Dependency Wheels. | ||
RUN pip wheel --wheel-dir /usr/src/app/wheels \ | ||
-r ${BUILD_ENVIRONMENT}.txt | ||
|
||
|
||
# Python 'run' stage | ||
FROM python as python-run-stage | ||
|
||
ARG BUILD_ENVIRONMENT=production | ||
ARG APP_HOME=/app | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV BUILD_ENV ${BUILD_ENVIRONMENT} | ||
|
||
WORKDIR ${APP_HOME} | ||
|
||
RUN addgroup --system django \ | ||
&& adduser --system --ingroup django django | ||
ARG BUILD_ENVIRONMENT=production | ||
ENV BUILD_ENV ${BUILD_ENVIRONMENT} | ||
|
||
ENV PATH="/root/.local/bin:${PATH}" \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 | ||
|
||
# Install required system dependencies | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
# psycopg2 dependencies | ||
libpq-dev \ | ||
# Translations dependencies | ||
gettext \ | ||
# cleaning up unused files | ||
curl libpq-dev build-essential gettext \ | ||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# All absolute dir copies ignore workdir instruction. All relative dir copies are wrt to the workdir instruction | ||
# copy python dependency wheels from python-build-stage | ||
COPY --from=python-build-stage /usr/src/app/wheels /wheels/ | ||
|
||
# use wheels to install python dependencies | ||
RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \ | ||
&& rm -rf /wheels/ | ||
|
||
|
||
COPY --chown=django:django ./compose/production/django/entrypoint /entrypoint | ||
RUN sed -i 's/\r$//g' /entrypoint | ||
RUN chmod +x /entrypoint | ||
|
||
|
||
COPY --chown=django:django ./compose/production/django/start /start | ||
RUN sed -i 's/\r$//g' /start | ||
RUN chmod +x /start | ||
COPY --chown=django:django ./compose/production/django/celery/worker/start /start-celeryworker | ||
RUN sed -i 's/\r$//g' /start-celeryworker | ||
RUN chmod +x /start-celeryworker | ||
|
||
|
||
COPY --chown=django:django ./compose/production/django/celery/beat/start /start-celerybeat | ||
RUN sed -i 's/\r$//g' /start-celerybeat | ||
RUN chmod +x /start-celerybeat | ||
|
||
|
||
COPY --chown=django:django ./compose/production/django/celery/flower/start /start-flower | ||
RUN sed -i 's/\r$//g' /start-flower | ||
RUN chmod +x /start-flower | ||
|
||
|
||
# copy application code to WORKDIR | ||
COPY --chown=django:django . ${APP_HOME} | ||
|
||
# make django owner of the WORKDIR directory as well. | ||
RUN chown django:django ${APP_HOME} | ||
ARG POETRY_VERSION | ||
ENV POETRY_VERSION="${POETRY_VERSION:-1.1.14}" | ||
RUN curl -sSL https://install.python-poetry.org \ | ||
| python - --version "${POETRY_VERSION}" \ | ||
&& poetry --version | ||
|
||
USER django | ||
COPY poetry.lock pyproject.toml . | ||
RUN poetry install --no-root | ||
|
||
RUN DATABASE_URL="" \ | ||
CELERY_BROKER_URL="" \ | ||
DJANGO_SETTINGS_MODULE="config.settings.test" \ | ||
python manage.py compilemessages | ||
COPY . ${APP_HOME} | ||
|
||
ENTRYPOINT ["/entrypoint"] | ||
RUN poetry install |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -111,7 +111,7 @@ description = "" | |
authors = ["Your Name <[email protected]>"] | ||
|
||
[tool.poetry.dependencies] | ||
python = "3.11" | ||
python = "~3.11" | ||
python-slugify = "8.0.1" | ||
Pillow = "10.0.1" | ||
argon2-cffi = "23.1.0" | ||
|