Skip to content

Commit

Permalink
fix Dockerfile runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Feb 12, 2024
1 parent 11d8ae2 commit 90a4ff8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dockerfile
README.md
tests\**
2 changes: 1 addition & 1 deletion .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
env:
# https://github.com/pytest-dev/pytest/issues/2042
PY_IGNORE_IMPORTMISMATCH: "1"
ENV QT_QPA_PLATFORM: offscreen
QT_QPA_PLATFORM: offscreen

jobs:
run:
Expand Down
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# The devcontainer should use the developer target and run as root with podman
# or docker with user namespaces.
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION} as system
FROM python:${PYTHON_VERSION} as developer

# Add any system dependencies for developer and runtime targets
# Add any system dependencies for the developer/build environment here
RUN apt-get update && apt-get install -y --no-install-recommends \
graphviz \
libglib2.0-0 \
libqt5gui5 libxcb-xinerama0 \
&& rm -rf /var/lib/apt/lists/*

FROM system as developer

# Set up a virtual environment and put it in PATH
RUN python -m venv /venv
ENV PATH=/venv/bin:$PATH
Expand All @@ -25,11 +24,16 @@ RUN pip install .

# The runtime stage copies the built venv into a slim runtime container
FROM python:${PYTHON_VERSION}-slim as runtime

# Add apt-get system dependecies for runtime here if needed
RUN apt-get update && apt-get install -y --no-install-recommends \
libqt5gui5 libxcb-xinerama0 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /venv/ /venv/
ENV PATH=/venv/bin:$PATH

# change this entrypoint if it is not the same as the repo
ENTRYPOINT ["dls-pmac-control"]
CMD ["--version"]


0 comments on commit 90a4ff8

Please sign in to comment.