blob: dac70664a3cfd6877d3936a10f56a3a37a3f6d6c [file] [log] [blame]
Oleksii Petrenko12508832020-07-10 18:13:53 +03001###########
2# BUILDER #
3###########
4
5# pull official base image
6FROM python:3.8.3-alpine as builder
7
8# set work directory
9WORKDIR /tmp
10
11
12# set environment variables
13ENV PYTHONDONTWRITEBYTECODE 1
14ENV PYTHONUNBUFFERED 1
15
16# install psycopg2 and uWSGI dependencies
17RUN apk update \
18 && apk add postgresql-dev gcc python3-dev musl-dev linux-headers
19
20# lint
21RUN pip install --upgrade pip
22RUN pip install flake8
23COPY . .
24RUN flake8 --ignore=E501,F401 .
25
26# install dependencies
27RUN pip wheel --no-cache-dir --no-deps --wheel-dir /tmp/wheels -r requirements.txt
28
29#########
30# FINAL #
31#########
32
Oleksii Petrenko24f1f8f2020-06-26 18:09:43 +030033FROM python:3.8.3-alpine
34ENV PYTHONUNBUFFERED 1
35COPY . /testrail_bot/
36WORKDIR /testrail_bot
37
Oleksii Petrenko12508832020-07-10 18:13:53 +030038RUN apk update && apk add libpq
39COPY --from=builder /tmp/wheels /wheels
40COPY --from=builder /tmp/requirements.txt .
41RUN pip install --no-cache /wheels/*