|
1 | 1 | FROM python:3.11 |
2 | 2 |
|
3 | 3 | LABEL org.opencontainers.image.source=https://github.com/AD-SDL/wei |
4 | | -LABEL org.opencontainers.image.description="The Workcell Execution Interface (WEI)" |
| 4 | +LABEL org.opencontainers.image.description="The Workflow Execution Interface (WEI)" |
5 | 5 | LABEL org.opencontainers.image.licenses=MIT |
6 | 6 |
|
| 7 | +RUN set -eux; \ |
| 8 | + apt-get update; \ |
| 9 | + apt-get install -y gosu; \ |
| 10 | + rm -rf /var/lib/apt/lists/* |
| 11 | + |
| 12 | +# User configuration |
7 | 13 | ARG USER_ID=9999 |
8 | 14 | ARG GROUP_ID=9999 |
9 | 15 | ARG CONTAINER_USER=app |
10 | 16 |
|
11 | | -ADD https://github.com/FooBarWidget/matchhostfsowner/releases/download/v1.0.1/matchhostfsowner-1.0.1-x86_64-linux.gz /sbin/matchhostfsowner.gz |
12 | | -RUN gunzip /sbin/matchhostfsowner.gz && \ |
13 | | - chown root: /sbin/matchhostfsowner && \ |
14 | | - chmod +x /sbin/matchhostfsowner |
15 | | - |
16 | 17 | RUN groupadd -g ${GROUP_ID} ${CONTAINER_USER} |
17 | 18 | RUN useradd --create-home -u ${USER_ID} --shell /bin/bash -g ${CONTAINER_USER} ${CONTAINER_USER} |
18 | 19 |
|
19 | | -USER ${CONTAINER_USER} |
20 | 20 | WORKDIR /home/${CONTAINER_USER} |
21 | 21 |
|
22 | 22 | RUN mkdir -p wei/requirements |
23 | | -RUN mkdir -p .wei/temp |
24 | | -RUN mkdir .diaspora |
| 23 | +RUN mkdir -p .wei |
| 24 | +RUN mkdir -p .diaspora |
25 | 25 |
|
26 | 26 | # Install Python Dependencies first, for caching purposes |
27 | | -COPY --chown=${USER_ID}:${GROUP_ID} requirements/requirements.txt wei/requirements/requirements.txt |
28 | | -COPY --chown=${USER_ID}:${GROUP_ID} requirements/dev.txt wei/requirements/dev.txt |
29 | | -RUN --mount=type=cache,target=/home/${CONTAINER_USER}/.cache,uid=${USER_ID},gid=${GROUP_ID} \ |
| 27 | +COPY requirements/requirements.txt wei/requirements/requirements.txt |
| 28 | +COPY requirements/dev.txt wei/requirements/dev.txt |
| 29 | +RUN --mount=type=cache,target=/root/.cache \ |
30 | 30 | pip install -r wei/requirements/requirements.txt |
31 | 31 |
|
32 | 32 | # Copy wei files |
33 | | -COPY --chown=${USER_ID}:${GROUP_ID} wei wei/wei |
34 | | -COPY --chown=${USER_ID}:${GROUP_ID} tests wei/tests |
35 | | -COPY --chown=${USER_ID}:${GROUP_ID} pyproject.toml wei/pyproject.toml |
36 | | -COPY --chown=${USER_ID}:${GROUP_ID} README.md wei/README.md |
37 | | -COPY --chown=${USER_ID}:${GROUP_ID} scripts wei/scripts |
38 | | -COPY --chown=${USER_ID}:${GROUP_ID} workcell_defs wei/workcell_defs |
| 33 | +COPY wei wei/wei |
| 34 | +COPY tests wei/tests |
| 35 | +COPY pyproject.toml wei/pyproject.toml |
| 36 | +COPY README.md wei/README.md |
| 37 | +COPY scripts wei/scripts |
| 38 | + |
39 | 39 |
|
40 | 40 | # Install dependencies and wei |
41 | | -RUN --mount=type=cache,target=/home/${CONTAINER_USER}/.cache,uid=${USER_ID},gid=${GROUP_ID} \ |
| 41 | +RUN --mount=type=cache,target=/root/.cache \ |
42 | 42 | pip install -e wei |
43 | 43 |
|
44 | | -USER root |
45 | | - |
46 | | -ENTRYPOINT ["/sbin/matchhostfsowner"] |
| 44 | +COPY wei-entrypoint.sh /wei-entrypoint.sh |
| 45 | +RUN chmod +x /wei-entrypoint.sh |
| 46 | +ENTRYPOINT [ "/wei-entrypoint.sh" ] |
0 commit comments