-
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.
New best practice, see: pypa/pipenv#2762
- Loading branch information
Showing
10 changed files
with
24 additions
and
25 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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
FROM python:3-alpine | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# Add system dependencies | ||
# Add dependencies | ||
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev libffi-dev make | ||
|
||
# Allows docker to cache installed dependencies between builds | ||
COPY Pipfile* ./ | ||
RUN pip install pipenv | ||
RUN pipenv install --system --deploy --ignore-pipfile | ||
|
||
# Adds our application code to the image | ||
COPY . /code/ | ||
WORKDIR /code | ||
|
||
# Install dependencies | ||
RUN pipenv install --deploy --ignore-pipfile | ||
|
||
# Expose Django's port | ||
EXPOSE $PORT |
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,17 +1,16 @@ | ||
FROM python:3-alpine | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# Add system dependencies | ||
# Add dependencies | ||
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev libffi-dev make | ||
|
||
# Allows docker to cache installed dependencies between builds | ||
COPY Pipfile* ./ | ||
RUN pip install pipenv | ||
RUN pipenv install --dev --system --deploy --ignore-pipfile | ||
|
||
# Adds our application code to the image | ||
COPY . /code/ | ||
WORKDIR /code | ||
|
||
# Install dependencies | ||
RUN pipenv install --deploy --ignore-pipfile --dev | ||
|
||
# Expose Django's port | ||
EXPOSE $PORT |
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,3 +1,3 @@ | ||
#!/bin/bash | ||
python manage.py migrate | ||
python manage.py collectstatic --noinput | ||
#!/bin/sh | ||
pipenv run python manage.py migrate | ||
pipenv run python manage.py collectstatic --noinput |
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,2 +1,2 @@ | ||
#!/bin/sh | ||
celery -A config.celery worker -l info | ||
pipenv run celery -A config.celery worker -l info |
2 changes: 1 addition & 1 deletion
2
{{ cookiecutter.project_slug }}/scripts/heroku/run_celery_beat.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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/sh | ||
celery -A config.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler | ||
pipenv run celery -A config.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler |
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,2 +1,2 @@ | ||
#!/bin/sh | ||
gunicorn config.wsgi:application -b 0.0.0.0:${PORT} -k config.server.production.ProductionUvicornWorker --access-logfile - | ||
pipenv run gunicorn config.wsgi:application -b 0.0.0.0:${PORT} -k config.server.production.ProductionUvicornWorker --access-logfile - |
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,2 +1,2 @@ | ||
#!/bin/sh | ||
watchmedo auto-restart --patterns="*.py" -d api -- celery -A config.celery worker -l info | ||
pipenv run watchmedo auto-restart --patterns="*.py" -d api -- celery -A config.celery worker -l info |
2 changes: 1 addition & 1 deletion
2
{{ cookiecutter.project_slug }}/scripts/local/run_celery_beat.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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/sh | ||
watchmedo auto-restart --patterns="*.py" -d api -- celery -A config.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler | ||
pipenv run watchmedo auto-restart --patterns="*.py" -d api -- celery -A config.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler |
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,4 +1,4 @@ | ||
#!/bin/sh | ||
python scripts/local/wait_for_postgres.py | ||
python manage.py migrate | ||
python manage.py runserver 0.0.0.0:8000 | ||
pipenv run python scripts/local/wait_for_postgres.py | ||
pipenv run python manage.py migrate | ||
pipenv run python 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/bin/sh | ||
flake8 . && | ||
black --check . && | ||
python scripts/local/wait_for_postgres.py && | ||
pytest --cov=./ | ||
pipenv run \ | ||
flake8 . && | ||
black --check . && | ||
python scripts/local/wait_for_postgres.py && | ||
pytest --cov=./ |