-
Notifications
You must be signed in to change notification settings - Fork 243
/
Dockerfile
53 lines (38 loc) · 1.13 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM ubuntu:20.04 AS builder
# Install system tools
RUN apt-get clean && \
apt-get -y update && \
apt-get install -y \
python3-dev \
build-essential \
libpq-dev \
virtualenv && \
apt-get clean
WORKDIR /anyway
COPY requirements.txt /anyway
# We create the venv inside a builder container to avoid pulling in build deps into final image
RUN virtualenv /venv3 -p python3
RUN . /venv3/bin/activate && \
pip install -U setuptools wheel && \
pip install --upgrade pip && \
pip install -r requirements.txt
RUN find /venv3 -name '*.so' | xargs strip
FROM ubuntu:20.04 AS runtime
RUN apt-get clean && \
apt-get -y update && \
apt-get install -y \
postgresql-client \
virtualenv && \
apt-get clean
WORKDIR /anyway
COPY --from=builder /venv3 /venv3
ENV VIRTUAL_ENV=/venv3
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV ALLOW_ALEMBIC_UPGRADE=yes
ENV FLASK_APP=anyway
ENV FLASK_ENV=development
COPY . /anyway
EXPOSE 5000
RUN flask assets clean
ENTRYPOINT ["/anyway/docker-entrypoint.sh"]
CMD FLASK_APP=anyway flask run --host 0.0.0.0