Files
speckle-server/packages/ifc-importer/Dockerfile
T
Gergő Jedlicska 520e931211 Gergo/web 3685 create new standalone python app for speckleifc based parser (#5051)
* feat(backgroundjobs): add new background jobs module for file imports
queueing

* fix(fileuploads): a merge gone wrong

* feat(backgroundjobs): rename rhino queue env var

* test(backgroundjob): use deep equal claude

* fix(fileuploads): sync PR review

* feat(ifc_importer): initial importer app implementation with a sleeping
worker

* chore(pre-commit): remove black as a formatter, its now handled by ruff

* fix(ifc-importer): better handling of max job attempt

* feat(eslint): ignore package from eslint
2025-07-11 20:12:43 +02:00

57 lines
1.3 KiB
Docker

FROM python:3.13-slim-bookworm AS build
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# - Silence uv complaining about not being able to use hard links,
# - tell uv to byte-compile packages for faster application startups,
# - prevent uv from accidentally downloading isolated Python builds,
# - pick a Python (use `/usr/bin/python3.12` on uv 0.5.0 and later),
# - and finally declare `/app` as the target for `uv sync`.
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
UV_PYTHON=python3.13 \
UV_PROJECT_ENVIRONMENT=/app
COPY pyproject.toml uv.lock /
# Install dependencies using uv
RUN uv sync --frozen --no-dev --no-install-project
COPY . /src
WORKDIR /src
RUN --mount=type=cache,target=/root/.cache \
uv sync \
--locked \
--no-dev \
--no-editable
FROM python:3.13-slim-bookworm
#
# Optional: add the application virtualenv to search path.
ENV PATH=/app/bin:$PATH
# Don't run your app as root.
RUN <<EOT
groupadd -r app
useradd -r -d /app -g app -N app
EOT
STOPSIGNAL SIGINT
COPY --from=build --chown=app:app /app /app
COPY --chown=app:app main.py /app
# COPY --chown=appuser:appuser . .
#
# Switch to non-root user
USER app
WORKDIR /app
# Reset the entrypoint, don't invoke `uv`
ENTRYPOINT []
CMD ["python", "main.py"]