-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathDockerfile
31 lines (25 loc) · 1.19 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
FROM ubuntu:focal as base
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Moscow
# install dependencies
COPY ./scripts /tmp/scripts
COPY ./problem-solver/sc-machine/scripts /tmp/problem-solver/sc-machine/scripts
COPY ./problem-solver/sc-machine/requirements.txt /tmp/problem-solver/sc-machine/requirements.txt
RUN apt-get update && \
apt-get install -y --no-install-recommends sudo ccache tini tzdata && \
/tmp/scripts/install_problem_solver_deps.sh
FROM base as builder
ENV CCACHE_DIR=/ccache
RUN apt-get install -y --no-install-recommends git && \
/tmp/scripts/install_problem_solver_deps.sh --dev
COPY . /nika
WORKDIR /nika/scripts
RUN --mount=type=cache,target=/ccache/ ./build_problem_solver.sh -r
FROM base as final
COPY --from=builder /nika/problem-solver/sc-machine/scripts /nika/problem-solver/sc-machine/scripts
COPY --from=builder /nika/problem-solver/sc-machine/requirements.txt /nika/problem-solver/sc-machine/requirements.txt
COPY --from=builder /nika/bin /nika/bin
COPY --from=builder /nika/scripts /nika/scripts
COPY --from=builder /nika/nika.ini /nika/nika.ini
WORKDIR /nika/scripts
ENTRYPOINT ["/usr/bin/tini", "--", "/nika/problem-solver/sc-machine/scripts/docker_entrypoint.sh"]