Skip to content

Commit

Permalink
Merge pull request #494 from OpenUpSA/sys/dockerise
Browse files Browse the repository at this point in the history
Sys/dockerise
  • Loading branch information
paulmwatson authored Jul 24, 2023
2 parents d8f027c + b44373d commit 15cb2a3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
1 change: 0 additions & 1 deletion .buildpacks

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# C extensions
*.so

*.env

# Packages
*.egg
*.egg-info
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM python:3.7.17-slim-bullseye

ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1

RUN set -ex \
&& addgroup --system --gid 1001 appuser \
&& adduser --system --uid 1001 --gid 1001 --no-create-home appuser \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y build-essential \
&& apt-get install -y libpq-dev \
&& apt-get install -y git \
&& apt-get install -y libmagic1 \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
RUN chown -R appuser:appuser /app

USER appuser

EXPOSE 5000
3 changes: 2 additions & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
web: gunicorn --workers $GUNICORN_WORKERS --worker-class gevent --timeout $GUNICORN_TIMEOUT --max-requests $GUNICORN_MAX_REQUESTS --max-requests-jitter 100 --log-file - --access-logfile - pmg:app
#web: gunicorn --workers $GUNICORN_WORKERS --worker-class gevent --timeout $GUNICORN_TIMEOUT --max-requests $GUNICORN_MAX_REQUESTS --max-requests-jitter 100 --log-file - --access-logfile - pmg:app
web: gunicorn --workers 5 --worker-class gevent --timeout 30 --max-requests 10000 --max-requests-jitter 100 --log-file - --access-logfile - pmg:app
worker: python app.py start_scheduler
1 change: 0 additions & 1 deletion runtime.txt

This file was deleted.

0 comments on commit 15cb2a3

Please sign in to comment.