Skip to content

Commit 6ca62c0

Browse files
committed
Add Dockerfile
1 parent abe6596 commit 6ca62c0

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Diff for: .dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.gitignore

Diff for: Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM python:3.11-slim
2+
3+
ENV VIRTUAL_ENV=/venv
4+
5+
RUN useradd calmerge --create-home && mkdir /app $VIRTUAL_ENV && chown -R calmerge /app $VIRTUAL_ENV
6+
7+
WORKDIR /app
8+
9+
# Install poetry at the system level
10+
RUN pip install --no-cache poetry==1.8.2
11+
12+
USER calmerge
13+
14+
RUN python -m venv $VIRTUAL_ENV
15+
16+
ENV PATH=$VIRTUAL_ENV/bin:$PATH
17+
18+
COPY --chown=calmerge pyproject.toml poetry.lock ./
19+
20+
RUN pip install --no-cache --upgrade pip && poetry install --no-dev --no-root && rm -rf $HOME/.cache
21+
22+
COPY --chown=calmerge . .
23+
24+
# Run poetry install again to install our project
25+
RUN poetry install --no-dev
26+
27+
RUN python -m compileall -q $VIRTUAL_ENV .
28+
29+
CMD ["/venv/bin/calmerge", "serve"]

0 commit comments

Comments
 (0)