forked from Flared/saturn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (28 loc) · 824 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
###########
## BUILD ##
###########
FROM python:3.10-slim-bullseye as build
RUN apt-get update \
&& apt-get install -y git build-essential \
&& rm -rf /var/lib/apt/lists/*
ENV POETRY_VERSION=1.1.11
RUN pip install poetry==${POETRY_VERSION}
WORKDIR /opt/saturn
ADD pyproject.toml poetry.lock README.md ./
ADD src ./src
RUN poetry build
################
## MAIN IMAGE ##
################
FROM python:3.10-slim-bullseye
RUN apt-get update \
&& apt-get install -y git build-essential \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /opt/saturn/dist/*.whl /opt/saturn/
RUN pip install /opt/saturn/*.whl \
&& rm -rf /opt/saturn
ENV SATURN_FLASK_HOST=0.0.0.0
ENV SATURN_FLASK_PORT=80
ENV SATURN_DATABASE_URL=sqlite:///tmp/saturn.sqlite
EXPOSE 80
CMD python -m saturn_engine.worker_manager.server