-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (16 loc) · 729 Bytes
/
Copy pathDockerfile
File metadata and controls
22 lines (16 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM python:3.11-slim
# NOTE: MoMo uses hatch-vcs (dynamic version from git metadata). The build
# context MUST include the .git directory or the version cannot be resolved.
# There is no .dockerignore, so `COPY . /app` below already includes it -- do
# not add .git to .dockerignore/.gitignore for the build context.
# Run as an unprivileged user instead of root.
RUN useradd --create-home --uid 1000 --shell /bin/bash momo
WORKDIR /app
# Copy the source (incl. .git for hatch-vcs) and install the base package only.
# Dev/test extras (.[dev]) are intentionally excluded from the production image.
COPY . /app
RUN pip install --no-cache-dir . \
&& chown -R momo:momo /app
USER momo
ENTRYPOINT ["momo"]
CMD ["version"]