-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (33 loc) · 741 Bytes
/
Dockerfile
File metadata and controls
45 lines (33 loc) · 741 Bytes
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
FROM python:3.7-alpine
ARG UID=1500
ARG GID=1500
ARG PORT=8080
# workaround for CMD not being able to parse variable at build time
ENV PORT ${PORT}
# enables propper stdout flushing
ENV PYTHONUNBUFFERED 1
WORKDIR /code
RUN apk add --no-cache \
git \
gcc \
make \
libffi-dev \
musl-dev
# avoid cache invalidation after copying entire directory
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN apk del \
git \
gcc \
make \
libffi-dev \
musl-dev
COPY . .
COPY config /config
EXPOSE ${PORT}
RUN addgroup -g $GID -S iomirea && \
adduser -u $UID -S api -G iomirea
RUN chown -R api:iomirea /code
RUN chown -R api:iomirea /config
USER api
CMD python iomirea/app.py --port=$PORT --host=0.0.0.0