-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
51 lines (39 loc) · 1.28 KB
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
FROM python:3.12-slim as base
# Setup env
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONFAULTHANDLER 1
FROM base AS python-deps
# Install pipenv and compilation dependencies
RUN pip install pipenv
RUN apt-get update && apt-get install -y --no-install-recommends gcc
# Install python dependencies in /.venv
COPY Pipfile .
COPY Pipfile.lock .
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
FROM base AS runtime
# Create new user
RUN useradd --create-home app
# Copy virtual env from python-deps stage
COPY --from=python-deps --chown=app:app /.venv /.venv
ENV PATH="/.venv/bin:$PATH"
# Disable entrypoint script development environment check
ENV PIPENV_ACTIVE=1
# Switch to new user
USER app
WORKDIR /home/app
# Persistent volumes for output files
RUN mkdir /home/app/chart
RUN mkdir /home/app/log
RUN mkdir /home/app/result
VOLUME /home/app/chart
VOLUME /home/app/log
VOLUME /home/app/result
# Install application into container
COPY --chown=app:app . .
# Run the scenario
# ENTRYPOINT ["python", "-m", "src.placement"]
# CMD ["--clear", "-i", "data/ids/infrastructure.json", "-d", "data/ids", "-w", "data/ids/traces/workload-83-600.json", "-s", "hrc_hrc", "-c", "fifo", "-t", "least_penalty", "-k", "30", "-q", "100"]
ENTRYPOINT ["bash"]
CMD ["./scenario-ids.sh"]