Skip to content

Commit 33bd4aa

Browse files
committed
messed up
1 parent 952420c commit 33bd4aa

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
21
# Use a Python image with uv pre-installed
32
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS uv
43

5-
# Set the working directory in the container
4+
# Install the project into `/app`
65
WORKDIR /app
76

87
# Enable bytecode compilation
98
ENV UV_COMPILE_BYTECODE=1
109

11-
# Copy the necessary project files
12-
COPY pyproject.toml uv.lock /app/
10+
# Copy from the cache instead of linking since it's a mounted volume
11+
ENV UV_LINK_MODE=copy
1312

14-
# Install the project's dependencies using the lockfile
13+
# Install the project's dependencies using the lockfile and settings
1514
RUN --mount=type=cache,target=/root/.cache/uv \
15+
--mount=type=bind,source=uv.lock,target=uv.lock \
16+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
1617
uv sync --frozen --no-install-project --no-dev --no-editable
1718

18-
# Add the rest of the project source code and install it
19-
COPY src /app/src
20-
19+
# Then, add the rest of the project source code and install it
20+
# Installing separately from its dependencies allows optimal layer caching
21+
ADD . /app
2122
RUN --mount=type=cache,target=/root/.cache/uv \
2223
uv sync --frozen --no-dev --no-editable
2324

24-
# Runtime base
2525
FROM python:3.12-slim-bookworm
2626

2727
WORKDIR /app
28-
28+
2929
COPY --from=uv /root/.local /root/.local
30-
COPY --from=uv /app/.venv /app/.venv
30+
COPY --from=uv --chown=app:app /app/.venv /app/.venv
3131

32-
# Set environment variable for Python path
32+
# Place executables in the environment at the front of the path
3333
ENV PATH="/app/.venv/bin:$PATH"
3434

35-
# Default command to run the server
35+
# when running the container, add --db-path and a bind mount to the host's db file
3636
ENTRYPOINT ["mcp-server-rabbitmq"]

0 commit comments

Comments
 (0)