Skip to content

Commit ca73874

Browse files
committed
applied corrections from the review
Signed-off-by: Oleksander Piskun <[email protected]>
1 parent 23d2ce1 commit ca73874

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

Dockerfile

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,7 @@ RUN apt-get update && apt-get install -y curl && \
1010
# Copy requirements and install Python dependencies using a cache mount.
1111
COPY requirements.txt /
1212
RUN --mount=type=cache,target=/root/.cache/pip \
13-
python3 -m pip install -r requirements.txt && rm requirements.txt
14-
15-
# Add application files (using your ADD patterns)
16-
ADD /ex_app/cs[s] /ex_app/css
17-
ADD /ex_app/im[g] /ex_app/img
18-
ADD /ex_app/j[s] /ex_app/js
19-
ADD /ex_app/l10[n] /ex_app/l10n
20-
ADD /ex_app/li[b] /ex_app/lib
21-
22-
# Copy scripts with the proper permissions.
23-
COPY --chmod=775 healthcheck.sh /
24-
COPY --chmod=775 start.sh /
13+
python3 -m pip install --root-user-action=ignore -r requirements.txt && rm requirements.txt
2514

2615
# Download and install FRP client into /usr/local/bin.
2716
RUN set -ex; \
@@ -44,16 +33,23 @@ RUN set -ex; \
4433
#############################
4534
FROM python:3.12-slim-bookworm
4635

36+
# Copy installed Python packages and FRP client from the builder.
37+
COPY --from=builder /usr/local/ /usr/local/
38+
4739
# Install any runtime apt packages your app needs.
4840
RUN apt-get update && apt-get install -y curl procps && \
4941
apt-get clean && rm -rf /var/lib/apt/lists/*
5042

51-
# Copy installed Python packages and FRP client from the builder.
52-
COPY --from=builder /usr/local/ /usr/local/
53-
# Copy application files and scripts from the builder.
54-
COPY --from=builder /ex_app/ /ex_app/
55-
COPY --from=builder /healthcheck.sh /healthcheck.sh
56-
COPY --from=builder /start.sh /start.sh
43+
# Add application files.
44+
ADD /ex_app/cs[s] /ex_app/css
45+
ADD /ex_app/im[g] /ex_app/img
46+
ADD /ex_app/j[s] /ex_app/js
47+
ADD /ex_app/l10[n] /ex_app/l10n
48+
ADD /ex_app/li[b] /ex_app/lib
49+
50+
# Copy scripts with the proper permissions.
51+
COPY --chmod=775 healthcheck.sh /
52+
COPY --chmod=775 start.sh /
5753

5854
# Set working directory and define entrypoint/healthcheck.
5955
WORKDIR /ex_app/lib

0 commit comments

Comments
 (0)