-
Notifications
You must be signed in to change notification settings - Fork 233
/
Copy pathDockerfile
40 lines (33 loc) · 1.08 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
FROM python:3.7-slim as python_builder
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
build-essential \
curl
# install poetry
# keep this in sync with the version in pyproject.toml and Dockerfile
ENV POETRY_VERSION 1.0.3
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
ENV PATH "/root/.poetry/bin:/opt/venv/bin:${PATH}"
# install dependencies
COPY . /app/
RUN python -m venv /opt/venv && \
. /opt/venv/bin/activate && \
pip install --no-cache-dir -U pip && \
cd /app && \
poetry install --no-dev --no-interaction
# start a new build stage
FROM python:3.7-slim
# copy everything from /opt
COPY --from=python_builder /opt/venv /opt/venv
COPY --from=python_builder /app /app
ENV PATH="/opt/venv/bin:$PATH"
# update permissions & change user
RUN chgrp -R 0 /app && chmod -R g=u /app
USER 1001
# change shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# create a mount point for custom actions and the entry point
WORKDIR /app
EXPOSE 5055
ENTRYPOINT ["./entrypoint.sh"]
CMD ["start", "--actions", "actions"]