-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
45 lines (31 loc) · 1.02 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
# syntax=docker/dockerfile:1.5
# This image is used for host the node.
# Build stage -----------------------------------------------------------------
FROM python:3.10 AS builder
# install virtual environment
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
# copy source files
COPY . /flotta
RUN --mount=type=cache,target=/root/.cache \
python -m pip install --upgrade pip \
&& \
pip install "/flotta"
# Installation stage ----------------------------------------------------------
FROM python:3.10-slim-buster AS base
# copy built virtual environment to base
COPY --from=builder /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
RUN useradd -m -d /flotta flotta
# create and populate workdir
USER flotta
WORKDIR /flotta
RUN mkdir -p \
/flotta/storage/datasources \
/flotta/storage/artifacts \
/flotta/storage/clients \
/flotta/storage/results \
/flotta/logs && \
chown -R flotta:flotta /flotta/
EXPOSE 1456
ENTRYPOINT ["python3", "-m", "flotta", "-c", "/flotta/config.yaml"]