Add docker files

This commit is contained in:
2025-05-10 08:45:23 +02:00
parent e766b06d5c
commit e22f9b8f10
6 changed files with 127 additions and 0 deletions

30
docker/Dockerfile.backend Normal file
View File

@ -0,0 +1,30 @@
# this Dockerfile should be built from the repo root
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
ENV UV_PYTHON_DOWNLOADS=0
WORKDIR /build
COPY . /build
RUN uv build --package sshecret
RUN uv build --package sshecret-backend
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
COPY --from=builder --chown=app:app /build/dist /opt/sshecret
RUN uv pip install --system /opt/sshecret/sshecret-*.whl
RUN uv pip install --system /opt/sshecret/sshecret_backend-*.whl
COPY packages/sshecret-backend /opt/sshecret-backend
COPY docker/backend.entrypoint.sh /entrypoint.sh
WORKDIR /opt/sshecret-backend
VOLUME /opt/sshecret-backend-db
EXPOSE 8022
CMD ["/entrypoint.sh"]