aboutsummaryrefslogtreecommitdiffstats
path: root/docker/app
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2019-09-28 06:20:07 +1000
committerGravatar scragly <[email protected]>2019-09-28 06:20:07 +1000
commit4769c8b5e3ba70301b1123c5750429b2092b01b1 (patch)
tree172f46a1b495a3b6948e183165a3e623b1462380 /docker/app
parentEnsure docker containers are published only for master branch bu… (#264) (diff)
Create custom manage.py entry point, remove scripts and merge Dockerfile.
Diffstat (limited to 'docker/app')
-rw-r--r--docker/app/Dockerfile27
-rw-r--r--docker/app/build-wiki.Dockerfile2
-rw-r--r--docker/app/local.Dockerfile28
-rw-r--r--docker/app/scripts/build-wiki.sh4
-rwxr-xr-xdocker/app/scripts/migrate.sh10
-rwxr-xr-xdocker/app/scripts/migrate_and_serve.sh21
-rw-r--r--docker/app/uwsgi.ini38
-rw-r--r--docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whlbin1287002 -> 0 bytes
8 files changed, 0 insertions, 130 deletions
diff --git a/docker/app/Dockerfile b/docker/app/Dockerfile
deleted file mode 100644
index a6986fb2..00000000
--- a/docker/app/Dockerfile
+++ /dev/null
@@ -1,27 +0,0 @@
-FROM python:3.7-slim
-
-# Allow service to handle stops gracefully
-STOPSIGNAL SIGQUIT
-
-# Set pip to have cleaner logs and no saved cache
-ENV PIP_NO_CACHE_DIR=false \
- PIPENV_HIDE_EMOJIS=1 \
- PIPENV_NOSPIN=1
-
-# Create non-root user.
-RUN useradd --system --shell /bin/false --uid 1500 pysite
-
-# Install pipenv & pyuwsgi
-RUN pip install -U pipenv pyuwsgi
-
-# Copy the project files into working directory
-WORKDIR /app
-COPY . .
-
-# Install project dependencies
-RUN pipenv install --system --deploy
-
-# Migrate, collect and start the app
-RUN chmod +x /app/docker/app/scripts/migrate.sh
-ENTRYPOINT ["/app/docker/app/scripts/migrate.sh"]
-CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]
diff --git a/docker/app/build-wiki.Dockerfile b/docker/app/build-wiki.Dockerfile
deleted file mode 100644
index 92003377..00000000
--- a/docker/app/build-wiki.Dockerfile
+++ /dev/null
@@ -1,2 +0,0 @@
-FROM python:3.7
-RUN pip --no-cache-dir wheel --wheel-dir=/wheels "wiki @ git+https://github.com/python-discord/django-wiki.git"
diff --git a/docker/app/local.Dockerfile b/docker/app/local.Dockerfile
deleted file mode 100644
index 9e15c438..00000000
--- a/docker/app/local.Dockerfile
+++ /dev/null
@@ -1,28 +0,0 @@
-FROM python:3.7-slim
-
-# Allow service to handle stops gracefully
-STOPSIGNAL SIGQUIT
-
-# Set pip to have cleaner logs and no saved cache
-ENV PIP_NO_CACHE_DIR=false \
- PIPENV_HIDE_EMOJIS=1 \
- PIPENV_NOSPIN=1
-
-# Create non-root user
-RUN useradd --system --shell /bin/false --uid 1500 pysite
-
-# Install pipenv & pyuwsgi
-RUN pip install -U pipenv pyuwsgi
-
-# Copy the project files into working directory
-WORKDIR /app
-COPY . .
-
-# Install project dependencies
-RUN pipenv install --system --deploy
-
-# Prepare static files for site
-RUN SECRET_KEY=placeholder DATABASE_URL=sqlite:// \
- python3 manage.py collectstatic --no-input --clear --verbosity 0
-
-CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]
diff --git a/docker/app/scripts/build-wiki.sh b/docker/app/scripts/build-wiki.sh
deleted file mode 100644
index 07c54f66..00000000
--- a/docker/app/scripts/build-wiki.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-docker build -t build_uwsgi -f docker/app/build-wiki.Dockerfile .
-CONTAINER=$(docker run -itd build_uwsgi /bin/bash)
-docker cp "$CONTAINER:/wheels" docker/app
-docker stop "$CONTAINER"
diff --git a/docker/app/scripts/migrate.sh b/docker/app/scripts/migrate.sh
deleted file mode 100755
index 22636c93..00000000
--- a/docker/app/scripts/migrate.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-echo --- Applying migrations ---
-python manage.py migrate --verbosity 1
-
-echo --- Collecting static files ---
-python manage.py collectstatic --no-input --clear --verbosity 1
-
-echo --- Starting uwsgi ---
-exec "$@" # This runs the CMD at the end of the Dockerfile
diff --git a/docker/app/scripts/migrate_and_serve.sh b/docker/app/scripts/migrate_and_serve.sh
deleted file mode 100755
index c30d7e04..00000000
--- a/docker/app/scripts/migrate_and_serve.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-set -eu
-
-### NOTE
-# This file is intended to be used by local setups.
-# You do not want to run the Django development server
-# in production. The default Dockerfile command will
-# run using uWSGI, this script is provided purely as
-# a convenience to run migrations and start a development server.
-
-echo [i] Applying migrations.
-python manage.py migrate --verbosity 1
-
-echo [i] Collecting static files.
-python manage.py collectstatic --no-input --clear --verbosity 1
-
-echo [i] Creating a superuser.
-echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin', 'admin') if not User.objects.filter(username='admin').exists() else print('Admin user already exists')" | python manage.py shell
-
-echo [i] Starting server.
-python manage.py runserver 0.0.0.0:8000
diff --git a/docker/app/uwsgi.ini b/docker/app/uwsgi.ini
deleted file mode 100644
index 3f35258c..00000000
--- a/docker/app/uwsgi.ini
+++ /dev/null
@@ -1,38 +0,0 @@
-[uwsgi]
-### Exposed ports
-# uWSGI protocol socket
-socket = :4000
-
-### File settings
-# WSGI application
-wsgi = pydis_site.wsgi:application
-# Directory to move into at startup
-chdir = /app
-
-### Concurrency options
-# Run a master to supervise the workers
-master = true
-# Keep a minimum of 1 worker
-cheaper = 1
-# Allow a maximum of 4 workers
-workers = 4
-# Automatically set up meanginful process names
-auto-procname = true
-# Prefix process names with `pydis_site : `
-procname-prefix-spaced = pydis_site :
-
-### Worker options
-# Kill workers if they take more than 30 seconds to respond.
-harakiri = 30
-
-### Startup settings
-# Exit if we can't load the app
-need-app = true
-# `setuid` to an unprivileged user
-uid = 1500
-# Do not use multiple interpreters
-single-interpreter = true
-
-### Hook setup
-# Gracefully kill workers on `SIGQUIT`
-hook-master-start = unix_signal:3 gracefully_kill_them_all
diff --git a/docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl b/docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl
deleted file mode 100644
index b7637e76..00000000
--- a/docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl
+++ /dev/null
Binary files differ