-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
40 lines (25 loc) · 941 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM python:3.6-alpine as base
LABEL maintainer = "Felix Fennell <felnne@bas.ac.uk>"
ENV APPPATH=/usr/src/app/
ENV PYTHONPATH=$APPPATH
RUN mkdir $APPPATH
WORKDIR $APPPATH
RUN apk add --no-cache libxslt-dev libffi-dev libressl-dev geos-dev proj-dev proj-util postgresql-dev
FROM base as build
ENV APPVENV=/usr/local/virtualenvs/scar_add_metadata_toolbox
RUN apk add --no-cache build-base
RUN python3 -m venv $APPVENV
ENV PATH="$APPVENV/bin:$PATH"
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir poetry==1.1.0
COPY pyproject.toml poetry.toml poetry.lock $APPPATH
RUN poetry install --no-root --no-interaction --no-ansi
FROM base as run
ENV APPVENV=/usr/local/virtualenvs/scar_add_metadata_toolbox
ENV PATH="$APPVENV/bin:$PATH"
ENV FLASK_APP=scar_add_metadata_toolbox
ENV FLASK_ENV=development
ENV PYTHONUNBUFFERED=1
COPY --from=build $APPVENV/ $APPVENV/
RUN mkdir -p /var/log/app/
ENTRYPOINT []