En cours - Travail sur un conteneur afin de lancer l'application avec UWSGI

This commit is contained in:
Olivier DOSSMANN 2017-08-22 23:15:30 +02:00
parent 242b0edff0
commit 46f9fea2c2
2 changed files with 31 additions and 1 deletions

30
Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM alpine:3.6
ENV APPS_DIR /opt/apps
ENV DB_DIR $APPS_DIR/db
ENV STATIC_ROOT $APPS_DIR/static
COPY requirements.txt $APPS_DIR/
WORKDIR $APPS_DIR
RUN set -ex \
&& buildDeps=' \
build-base \
python3-dev \
' \
&& apk --no-cache --update add \
mailcap \
python3 \
$buildDeps \
&& pip3 install --no-cache-dir --upgrade pip \
&& pip3 install --no-cache-dir --upgrade -r requirements.txt \
&& apk del $buildDeps \
&& rm -rf /var/cache/apk/*
COPY ./collection $APPS_DIR
VOLUME $DB_DIR
EXPOSE 8000
CMD ["/bin/sh"]

View File

@ -78,7 +78,7 @@ WSGI_APPLICATION = 'collection.wsgi.application'
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 'NAME': os.path.join(BASE_DIR, 'db', 'db.sqlite3'),
} }
} }