-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.client
44 lines (32 loc) · 1.17 KB
/
Dockerfile.client
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
FROM python:3.12
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,DL3009
RUN apt-get update && apt-get install -y \
curl \
wget
# Deliberately not removing the lists because the models
# don't seem to understand `apt-get update`.
RUN --mount=type=bind,source=main.c,target=/main.c \
gcc -o /main /main.c
RUN --mount=type=bind,source=pyproject.toml,target=/pyproject.toml \
pip3 install --no-cache-dir poetry==1.8.2 && \
poetry config virtualenvs.create false && \
poetry install --without=dev --with=client --with=main
ENV POCKET_ASI_MODULE=client
ENV POCKET_ASI_ROOT=/${POCKET_ASI_MODULE}
COPY ${POCKET_ASI_MODULE} ${POCKET_ASI_ROOT}
ARG POCKET_ASI_COPY_WORKSPACE=0
RUN --mount=type=bind,source=workspace,target=/mutable \
mkdir -p /app && \
if [ "${POCKET_ASI_COPY_WORKSPACE:-}" = "1" ]; then \
tar -c -C /mutable \
--exclude=__pycache__ \
. | tar -x -C /app; \
fi
ENV PYTHONPATH=/app
ENV PS1="\\\$? \\u@\\h:\\w \\$ "
ENV DEBIAN_FRONTEND=noninteractive
ENV POCKET_ASI_PYTHON=/usr/local/bin/python
ENV POCKET_ASI_LOADER=loader.py
WORKDIR /app
CMD ["/main"]