aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docker-compose.yml8
-rw-r--r--docker/app/Dockerfile (renamed from docker/app/stretch/3.7/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.6/Dockerfile39
-rw-r--r--docker/pysite.dockerapp2
6 files changed, 12 insertions, 113 deletions
diff --git a/docker-compose.yml b/docker-compose.yml
index 8519e763..2d3e8f3b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -20,14 +20,14 @@ services:
postgres:
image: postgres:11-alpine
environment:
- POSTGRES_DB: pydis_site
+ POSTGRES_DB: pysite
POSTGRES_PASSWORD: supersecretpassword
- POSTGRES_USER: pydis_site
+ POSTGRES_USER: pysite
web:
build:
context: .
- dockerfile: docker/app/alpine/3.7/Dockerfile
+ dockerfile: docker/app/Dockerfile
command: docker/app/migrate_and_serve.sh
ports:
- "127.0.0.1:8000:8000"
@@ -36,7 +36,7 @@ services:
volumes:
- .:/app:ro
environment:
- DATABASE_URL: postgres://pydis_site:supersecretpassword@postgres/pydis_site
+ DATABASE_URL: postgres://pysite:supersecretpassword@postgres/pysite
DEBUG: "true"
SECRET_KEY: suitable-for-development-only
diff --git a/docker/app/stretch/3.7/Dockerfile b/docker/app/Dockerfile
index a1538ddd..93d0c378 100644
--- a/docker/app/stretch/3.7/Dockerfile
+++ b/docker/app/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.7-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.6/Dockerfile b/docker/app/stretch/3.6/Dockerfile
deleted file mode 100644
index 5f97a510..00000000
--- a/docker/app/stretch/3.6/Dockerfile
+++ /dev/null
@@ -1,39 +0,0 @@
-FROM python:3.6-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