Commit 8915c45b authored by Luuk Scholten's avatar Luuk Scholten
Browse files

Merge branch 'docker-debian' into 'master'

Migrate Dockerfile to Debian

See merge request !407
parents 57e7c1b7 613b32ed
FROM python:3.5-alpine FROM python:3.5
MAINTAINER Thom Wiggers <thom@thomwiggers.nl> MAINTAINER Thom Wiggers <thom@thomwiggers.nl>
LABEL description="Contains the Thaliawebsite Django application" LABEL description="Contains the Thaliawebsite Django application"
...@@ -7,49 +7,23 @@ LABEL description="Contains the Thaliawebsite Django application" ...@@ -7,49 +7,23 @@ LABEL description="Contains the Thaliawebsite Django application"
# Disable output buffering # Disable output buffering
ENV DJANGO_PRODUCTION 1 ENV DJANGO_PRODUCTION 1
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND=noninteractive
RUN mkdir /concrexit # Create /concrexit dir
# Create log dir and log file
# Create log dir # Create app dir
RUN mkdir /concrexit/log/ RUN mkdir /concrexit && \
RUN touch /concrexit/log/uwsgi.log mkdir -p /concrexit/log/ && \
touch /concrexit/log/uwsgi.log && \
RUN chown -R 33:33 /concrexit chown -R www-data:www-data /concrexit && \
mkdir -p /usr/src/app
# Create app directory
RUN mkdir -p /usr/src/app
# Install dependencies # Install dependencies
RUN apk add --no-cache \ RUN apt-get update && apt-get install -y --no-install-recommends \
gettext \
bash \
postgresql-client \ postgresql-client \
libwebp \ gettext \
tiff \ ghostscript && \
zlib \ rm -rf /var/lib/apt
freetype \
lcms2 \
libffi \
ghostscript \
libjpeg-turbo
# Install build deps
RUN apk add --no-cache --virtual .builddeps \
build-base \
tiff-dev \
libjpeg-turbo-dev \
zlib-dev \
freetype-dev \
lcms2-dev \
libwebp-dev \
libffi-dev \
linux-headers \
git \
postgresql-dev
# Install mongodb separately because it's in edge still
RUN echo http://dl-4.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \
apk add --no-cache libsass
WORKDIR /usr/src/app WORKDIR /usr/src/app
# install python requirements # install python requirements
...@@ -61,17 +35,13 @@ RUN pip install --no-cache-dir \ ...@@ -61,17 +35,13 @@ RUN pip install --no-cache-dir \
-r production-requirements.txt \ -r production-requirements.txt \
-r dev-requirements.txt -r dev-requirements.txt
RUN apk del .builddeps
# Create entry points # Create entry points
WORKDIR /usr/local/bin
COPY resources/entrypoint.sh /usr/local/bin/entrypoint.sh COPY resources/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY resources/entrypoint_production.sh /usr/local/bin/entrypoint_production.sh COPY resources/entrypoint_production.sh /usr/local/bin/entrypoint_production.sh
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh && \
RUN chmod +x /usr/local/bin/entrypoint_production.sh chmod +x /usr/local/bin/entrypoint_production.sh
# copy app source # copy app source
WORKDIR /usr/src/app
COPY website /usr/src/app/ COPY website /usr/src/app/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
......
...@@ -46,6 +46,9 @@ DATABASES = { ...@@ -46,6 +46,9 @@ DATABASES = {
'DATABASE': os.environ.get('POSTGRES_DB'), 'DATABASE': os.environ.get('POSTGRES_DB'),
'HOST': os.environ.get('DJANGO_POSTGRES_HOST'), 'HOST': os.environ.get('DJANGO_POSTGRES_HOST'),
'PORT': 5432, 'PORT': 5432,
'TEST': {
'NAME': 'thaliatest',
}
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment