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
WORKDIR /app
COPY requirements.txt ./
COPY requirements.production.txt ./
COPY . ./
# uWSGI, gunicorn etc.
RUN apk add --no-cache python3-dev build-base linux-headers pcre-dev openssl bash \
ENV POETRY_VERSION=1.1.4
# 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
&& apk add --no-cache postgresql-dev \
# Pillow
&& apk add --no-cache jpeg-dev zlib-dev \
&& pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install -r requirements.production.txt
&& apk add --no-cache postgresql-dev
# System deps:
RUN pip install -U pip
RUN pip install "poetry==$POETRY_VERSION"
# Project initialization:
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi
RUN python manage.py collectstatic --noinput
-1
View File
@@ -13,7 +13,6 @@ services:
web:
build: .
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
ports: