update Dockerfile to use poetry

This commit is contained in:
Aarni Halinen
2021-03-29 21:40:38 +03:00
parent 4029031bf0
commit 78575075e5
2 changed files with 16 additions and 12 deletions
+16 -11
View File
@@ -1,19 +1,24 @@
FROM python:3.7-alpine FROM python:3.9-alpine
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
WORKDIR /app WORKDIR /app
COPY requirements.txt ./
COPY requirements.production.txt ./
COPY . ./ COPY . ./
# uWSGI, gunicorn etc. ENV POETRY_VERSION=1.1.4
RUN apk add --no-cache python3-dev build-base linux-headers pcre-dev openssl bash \
# Rust and shit https://cryptography.io/en/latest/installation.html
RUN apk --no-cache --update --upgrade add gcc musl-dev python3-dev libffi-dev openssl-dev cargo \
# Pillow and maybe some unnneeded?
jpeg-dev zlib-dev build-base linux-headers pcre-dev bash \
# PSQL # PSQL
&& apk add --no-cache postgresql-dev \ && apk add --no-cache postgresql-dev
# Pillow
&& apk add --no-cache jpeg-dev zlib-dev \ # System deps:
&& pip install --upgrade pip \ RUN pip install -U pip
&& pip install -r requirements.txt \ RUN pip install "poetry==$POETRY_VERSION"
&& pip install -r requirements.production.txt
# Project initialization:
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi
RUN python manage.py collectstatic --noinput RUN python manage.py collectstatic --noinput
-1
View File
@@ -13,7 +13,6 @@ services:
web: web:
build: . build: .
image: registry.gitlab.com/sahkoinsinoorikilta/vtmk/web2.0-backend image: registry.gitlab.com/sahkoinsinoorikilta/vtmk/web2.0-backend
command: ["bash", "-c", "cd /app & bash setup.sh --no-input --no-npm && gunicorn -w 4 -b 0.0.0.0:8000 sikweb.wsgi"]
env_file: env_file:
- .env - .env
ports: ports: