Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
--env GUNICORN_CMD_ARGS='--log-config logging_test.conf' \
--env ALLOW_STUDENT_NUMBER=true \
--env STATIC_FOLDER=/app/static \
--env STORAGE_TIME=30 \
--env AUTH_URL=https://auth.api.test.profcomff.com/ \
--name ${{ env.CONTAITER_NAME }} \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
Expand Down Expand Up @@ -172,6 +173,7 @@ jobs:
--env GUNICORN_CMD_ARGS='--log-config logging_prod.conf' \
--env ALLOW_STUDENT_NUMBER=true \
--env STATIC_FOLDER=/app/static \
--env STORAGE_TIME=168 \
--env AUTH_URL=https://auth.api.profcomff.com/ \
--name ${{ env.CONTAITER_NAME }} \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ ENV APP_NAME=print_service
ENV APP_MODULE=${APP_NAME}.routes.base:app

COPY ./requirements.txt /app/
RUN pip install -U -r /app/requirements.txt
RUN apt-get update && apt-get -y install cron && pip install -U -r /app/requirements.txt

COPY ./static /app/static/

COPY ./alembic.ini /alembic.ini
COPY ./logging_prod.conf /app/
COPY ./logging_test.conf /app/
COPY ./migrations /migrations/
COPY ./prestart.sh /app/prestart.sh

COPY ./${APP_NAME} /app/${APP_NAME}
7 changes: 7 additions & 0 deletions prestart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

echo "0 */1 * * * find $STATIC_FOLDER -type f -name \$(date -d \"-$STORAGE_TIME hours\" --iso)\"*\" -delete" | crontab -

cron

exec "$@"