-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into upgrade-poetry
- Loading branch information
Showing
53 changed files
with
1,676 additions
and
71 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 |
---|---|---|
|
@@ -83,3 +83,7 @@ Session.vim | |
|
||
# Pycharm project modules | ||
.idea/ | ||
|
||
|
||
### VSCode | ||
.vscode/ |
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,5 @@ | ||
default_context: | ||
enable_whitenoise: "y" | ||
add_celery: "y" | ||
add_graphql: "y" | ||
add_asgi: "y" |
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
15 changes: 15 additions & 0 deletions
15
{{cookiecutter.github_repository}}/.github/workflows/fly.yml
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,15 @@ | ||
name: Fly Deploy | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
deploy: | ||
name: Deploy app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: superfly/flyctl-actions/setup-flyctl@master | ||
- run: flyctl deploy --dockerfile ./compose/fly/django/Dockerfile | ||
env: | ||
FLY_API_TOKEN: ${{ "{{" }} secrets.FLY_API_TOKEN {{ "}}" }} |
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,15 @@ | ||
# Standard Library | ||
import os | ||
|
||
# Third Party Stuff | ||
from django.core.asgi import get_asgi_application | ||
from dotenv import load_dotenv | ||
|
||
# Read .env file and set key/value inside it as environment variables | ||
# see: http://github.com/theskumar/python-dotenv | ||
load_dotenv(os.path.join(os.path.dirname(__file__), ".env")) | ||
|
||
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.production") | ||
|
||
application = get_asgi_application() |
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
2 changes: 1 addition & 1 deletion
2
{{cookiecutter.github_repository}}/compose/dev/postgres/Dockerfile
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
64 changes: 64 additions & 0 deletions
64
{{cookiecutter.github_repository}}/compose/fly/django/Dockerfile
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,64 @@ | ||
ARG PYTHON_VERSION=3.9-slim-buster | ||
|
||
# define an alias for the specfic python version used in this file. | ||
FROM python:${PYTHON_VERSION} as python | ||
|
||
ENV POETRY_VERSION=1.3.2 | ||
|
||
ARG BUILD_ENVIRONMENT=dev | ||
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 | ||
|
||
# Install required system dependencies | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
# dependencies for building Python packages | ||
build-essential \ | ||
# psycopg2 dependencies | ||
libpq-dev \ | ||
# Translations dependencies | ||
gettext \ | ||
# Versatile image field & pillow \ | ||
libmagic1 \ | ||
libmagic-dev \ | ||
|
||
# cleaning up unused files | ||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Poetry | ||
RUN pip install --no-cache-dir poetry==${POETRY_VERSION} | ||
|
||
COPY poetry.lock pyproject.toml ${APP_HOME}/ | ||
|
||
# Project initialization: | ||
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi | ||
|
||
COPY --chown=django:django ./compose/dev/django/celery/worker/start /start-celeryworker | ||
RUN chmod +x /start-celeryworker | ||
|
||
|
||
COPY --chown=django:django ./compose/dev/django/celery/beat/start /start-celerybeat | ||
RUN chmod +x /start-celerybeat | ||
|
||
|
||
COPY ./compose/dev/django/celery/flower/start /start-flower | ||
RUN chmod +x /start-flower | ||
|
||
COPY --chown=django:django . ${APP_HOME} | ||
|
||
# make django owner of the WORKDIR directory as well. | ||
RUN chown django:django ${APP_HOME} | ||
|
||
RUN python manage.py collectstatic --noinput | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "wsgi:application"] |
Oops, something went wrong.