aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2019-04-05 20:59:22 +0100
committerGravatar Gareth Coles <[email protected]>2019-04-05 20:59:22 +0100
commitd576432e6145df464273f0f22d841cc9f5804b07 (patch)
treec229454c3b415cdacc950940283c1cdb80007783 /docker
parentpysite -> pydis_site (diff)
Address review by @jchristgit
Diffstat (limited to 'docker')
-rw-r--r--docker/app/Dockerfile (renamed from docker/app/stretch/3.6/Dockerfile)11
-rw-r--r--docker/app/alpine/3.6/Dockerfile33
-rw-r--r--docker/app/alpine/3.7/Dockerfile32
-rw-r--r--docker/app/stretch/3.7/Dockerfile39
-rw-r--r--docker/pysite.dockerapp2
5 files changed, 8 insertions, 109 deletions
diff --git a/docker/app/stretch/3.6/Dockerfile b/docker/app/Dockerfile
index 5f97a510..93d0c378 100644
--- a/docker/app/stretch/3.6/Dockerfile
+++ b/docker/app/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.6-stretch
+FROM bitnami/python:3.7-prod
STOPSIGNAL SIGQUIT
ARG EXTRAS=deploy
@@ -22,14 +22,17 @@ RUN apt-get update -y \
WORKDIR /app
-COPY Pipfile /app/Pipfile
-COPY Pipfile.lock /app/Pipfile.lock
+COPY Pipfile Pipfile.lock /app/
+
+RUN rm -r /opt/bitnami/python/lib/python3.*/site-packages/setuptools* && \
+ pip install --no-cache-dir -U setuptools
+
RUN python3 -m pip install pipenv \
&& python3 -m pipenv install --dev --system --deploy
COPY . .
-RUN python3 manage.py collectstatic --no-input --clear
+RUN SECRET_KEY=placeholder DATABASE_URL=sqlite:// python3 manage.py collectstatic --no-input --clear --verbosity 0
RUN apt-get purge -y \
gcc \
diff --git a/docker/app/alpine/3.6/Dockerfile b/docker/app/alpine/3.6/Dockerfile
deleted file mode 100644
index c40b6593..00000000
--- a/docker/app/alpine/3.6/Dockerfile
+++ /dev/null
@@ -1,33 +0,0 @@
-FROM python:3.6-alpine
-
-STOPSIGNAL SIGQUIT
-ARG EXTRAS=deploy
-
-RUN adduser \
- -D \
- -H \
- -u 1500 \
- pysite
-
-RUN apk add --no-cache --virtual build \
- gcc \
- linux-headers \
- musl-dev \
- && \
- apk add --no-cache \
- curl \
- postgresql-dev
-
-WORKDIR /app
-
-COPY Pipfile /app/Pipfile
-COPY Pipfile.lock /app/Pipfile.lock
-RUN python3 -m pip install pipenv \
- && python3 -m pipenv install --dev --system --deploy \
- && apk del --purge build
-
-COPY . .
-
-RUN python3 manage.py collectstatic --no-input --clear
-
-CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]
diff --git a/docker/app/alpine/3.7/Dockerfile b/docker/app/alpine/3.7/Dockerfile
deleted file mode 100644
index 9dfbfe09..00000000
--- a/docker/app/alpine/3.7/Dockerfile
+++ /dev/null
@@ -1,32 +0,0 @@
-FROM python:3.7-alpine
-
-STOPSIGNAL SIGQUIT
-
-RUN adduser \
- -D \
- -H \
- -u 1500 \
- pysite
-
-RUN apk add --no-cache --update --virtual build \
- gcc \
- linux-headers \
- musl-dev \
- && \
- apk add \
- curl \
- postgresql-dev
-
-WORKDIR /app
-
-COPY Pipfile /app/Pipfile
-COPY Pipfile.lock /app/Pipfile.lock
-RUN python3 -m pip install pipenv \
- && python3 -m pipenv install --dev --system --deploy \
- && apk del --purge build
-
-COPY . .
-
-RUN python3 manage.py collectstatic --no-input --clear
-
-CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]
diff --git a/docker/app/stretch/3.7/Dockerfile b/docker/app/stretch/3.7/Dockerfile
deleted file mode 100644
index a1538ddd..00000000
--- a/docker/app/stretch/3.7/Dockerfile
+++ /dev/null
@@ -1,39 +0,0 @@
-FROM python:3.7-stretch
-
-STOPSIGNAL SIGQUIT
-ARG EXTRAS=deploy
-
-RUN adduser \
- --disabled-login \
- --no-create-home \
- --uid 1500 \
- pysite
-
-RUN apt-get update -y \
- && \
- apt-get install --no-install-recommends -y \
- gcc \
- libc-dev \
- libpq-dev \
- && \
- apt-get clean \
- && \
- rm -rf /var/lib/apt/lists/*
-
-WORKDIR /app
-
-COPY Pipfile /app/Pipfile
-COPY Pipfile.lock /app/Pipfile.lock
-RUN python3 -m pip install pipenv \
- && python3 -m pipenv install --dev --system --deploy
-
-COPY . .
-
-RUN python3 manage.py collectstatic --no-input --clear
-
-RUN apt-get purge -y \
- gcc \
- libc-dev \
- libpq-dev
-
-CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]
diff --git a/docker/pysite.dockerapp b/docker/pysite.dockerapp
index 738fcfdd..dc472b2e 100644
--- a/docker/pysite.dockerapp
+++ b/docker/pysite.dockerapp
@@ -1,5 +1,5 @@
version: 0.3.0
-name: pydis_site
+name: pysite
description: |
Our community website, built on Django and PostgreSQL.
namespace: python-discord