Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect static files during deployment #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion {{cookiecutter.repostory_name}}/app/envs/prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ COPY ./envs/prod/celery-entrypoint.sh /root/src/
COPY ./envs/prod/prometheus-cleanup.sh /root/src/

RUN python3 -m compileall -b -f -q /root/
RUN ENV=prod ENV_FILL_MISSING_VALUES=1 SECRET_KEY=dummy python3 manage.py collectstatic --no-input --clear


FROM $BASE_IMAGE AS secondary-image
2 changes: 1 addition & 1 deletion {{cookiecutter.repostory_name}}/deploy.sh
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ BASE_IMAGE=$(docker images --quiet --filter="label=builder=true" | head -n1)
docker image tag ${BASE_IMAGE} {{cookiecutter.django_project_name}}/app-builder

# collect static files to external storage while old app is still running
# docker-compose run --rm app sh -c "python manage.py collectstatic --no-input"
docker-compose run --rm app sh -c "python manage.py collectstatic --noinput"

SERVICES=$(docker-compose ps --services 2>&1 > /dev/stderr \
| grep -v -e 'is not set' -e nginx -e db -e redis)