Skip to content

Commit 0bdad39

Browse files
committed
Revert changes to server & scheduler images
1 parent 6552f6b commit 0bdad39

File tree

3 files changed

+28
-41
lines changed

3 files changed

+28
-41
lines changed

docker/Dockerfile.scheduler

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
ARG PYTHON_VERSION=3.13
44
FROM python:$PYTHON_VERSION-slim-bookworm AS base
55

6-
RUN useradd syncmaster --create-home && \
7-
mkdir -p /home/syncmaster && \
8-
chown -R syncmaster:syncmaster /home/syncmaster
9-
106
WORKDIR /app
117
ENV PYTHONPATH=/app \
128
PATH="/app/.venv/bin:$PATH"
139

10+
COPY --chmod=755 ./docker/entrypoint_scheduler.sh /app/entrypoint.sh
11+
ENTRYPOINT ["/app/entrypoint.sh"]
12+
1413

1514
FROM base AS builder
1615

@@ -33,12 +32,10 @@ FROM base AS prod
3332
COPY --link --from=builder /app/.venv/ /app/.venv/
3433
COPY ./syncmaster/ /app/syncmaster/
3534
RUN python -m compileall -b /app/syncmaster
36-
COPY ./pyproject.toml ./uv.lock /app/syncmaster/
3735

38-
COPY --chmod=755 ./docker/entrypoint_scheduler.sh /app/entrypoint.sh
39-
ENTRYPOINT ["/app/entrypoint.sh"]
4036
# Do not run production as root, to improve security.
4137
# Also user does not own anything inside the image, including venv and source code.
38+
RUN useradd syncmaster
4239
USER syncmaster
4340

4441

@@ -54,6 +51,4 @@ RUN --mount=type=cache,target=/root/.cache/uv \
5451
--group "test" \
5552
--compile-bytecode
5653

57-
COPY --chmod=755 ./docker/entrypoint_scheduler.sh /app/entrypoint.sh
5854
RUN sed -i 's/python -m/coverage run -m/g' /app/entrypoint.sh
59-
ENTRYPOINT ["/app/entrypoint.sh"]

docker/Dockerfile.server

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,29 @@ RUN apt-get update \
99
curl \
1010
&& rm -rf /var/lib/apt/lists/* /var/cache/*
1111

12-
RUN useradd syncmaster --create-home && \
13-
mkdir -p /home/syncmaster && \
14-
chown -R syncmaster:syncmaster /home/syncmaster
15-
1612
WORKDIR /app
1713
ENV PYTHONPATH=/app \
1814
PATH="/app/.venv/bin:$PATH"
1915

16+
COPY ./docs/_static/*.svg /app/syncmaster/server/static/
17+
18+
# Swagger UI
19+
ADD --chmod=644 https://cdn.jsdelivr.net/npm/swagger-ui-dist@latest/swagger-ui-bundle.js https://cdn.jsdelivr.net/npm/swagger-ui-dist@latest/swagger-ui.css \
20+
/app/syncmaster/server/static/swagger/
21+
22+
# Redoc
23+
ADD --chmod=644 https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js /app/syncmaster/server/static/redoc/redoc.standalone.js
24+
25+
ENV SYNCMASTER__SERVER__OPENAPI__SWAGGER__JS_URL=/static/swagger/swagger-ui-bundle.js \
26+
SYNCMASTER__SERVER__OPENAPI__SWAGGER__CSS_URL=/static/swagger/swagger-ui.css \
27+
SYNCMASTER__SERVER__OPENAPI__REDOC__JS_URL=/static/redoc/redoc.standalone.js \
28+
SYNCMASTER__SERVER__STATIC_FILES__DIRECTORY=/app/syncmaster/server/static
29+
30+
COPY --chmod=755 ./docker/entrypoint_server.sh /app/entrypoint.sh
31+
ENTRYPOINT ["/app/entrypoint.sh"]
32+
EXPOSE 8000
33+
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD ["curl", "-f", "http://localhost:8000/monitoring/ping"]
34+
2035

2136
FROM base AS builder
2237

@@ -36,30 +51,12 @@ FROM base AS prod
3651

3752
COPY --link --from=builder /app/.venv/ /app/.venv/
3853

39-
COPY ./docs/_static/*.svg /app/syncmaster/server/static/
40-
41-
# Swagger UI
42-
ADD https://cdn.jsdelivr.net/npm/swagger-ui-dist@latest/swagger-ui-bundle.js https://cdn.jsdelivr.net/npm/swagger-ui-dist@latest/swagger-ui.css \
43-
/app/syncmaster/server/static/swagger/
44-
45-
# Redoc
46-
ADD https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js /app/syncmaster/server/static/redoc/redoc.standalone.js
47-
48-
ENV SYNCMASTER__SERVER__OPENAPI__SWAGGER__JS_URL=/static/swagger/swagger-ui-bundle.js \
49-
SYNCMASTER__SERVER__OPENAPI__SWAGGER__CSS_URL=/static/swagger/swagger-ui.css \
50-
SYNCMASTER__SERVER__OPENAPI__REDOC__JS_URL=/static/redoc/redoc.standalone.js \
51-
SYNCMASTER__SERVER__STATIC_FILES__DIRECTORY=/app/syncmaster/server/static
52-
5354
COPY ./syncmaster/ /app/syncmaster/
5455
RUN python -m compileall -b /app/syncmaster
55-
COPY ./pyproject.toml ./uv.lock /app/syncmaster/
5656

57-
COPY --chmod=755 ./docker/entrypoint_scheduler.sh /app/entrypoint.sh
58-
ENTRYPOINT ["/app/entrypoint.sh"]
59-
EXPOSE 8000
60-
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD ["curl", "-f", "http://localhost:8000/monitoring/ping"]
6157
# Do not run production as root, to improve security.
6258
# Also user does not own anything inside the image, including venv and source code.
59+
RUN useradd syncmaster
6360
USER syncmaster
6461

6562

@@ -74,8 +71,4 @@ RUN --mount=type=cache,target=/root/.cache/uv \
7471
--group "test" \
7572
--compile-bytecode
7673

77-
COPY --chmod=755 ./docker/entrypoint_server.sh /app/entrypoint.sh
7874
RUN sed -i 's/python -m/coverage run -m/g' /app/entrypoint.sh
79-
ENTRYPOINT ["/app/entrypoint.sh"]
80-
EXPOSE 8000
81-
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD ["curl", "-f", "http://localhost:8000/monitoring/ping"]

docker/Dockerfile.worker

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ WORKDIR /app
2020
ENV PYTHONPATH=/app \
2121
PATH="/app/.venv/bin:$PATH"
2222

23+
COPY --chmod=755 ./docker/entrypoint_worker.sh /app/entrypoint.sh
24+
ENTRYPOINT ["/app/entrypoint.sh"]
25+
2326

2427
FROM base AS builder
2528

@@ -94,12 +97,10 @@ COPY --link --from=builder /app/.venv/ /app/.venv/
9497
# using --link to make ~/.ivy2 a separated layer in docker image, not based on previous layers
9598
COPY --link --from=ivy2_packages /home/syncmaster/.ivy2/ /home/syncmaster/.ivy2/
9699
# If someone needs to use worker image with root user, use the same jars
97-
RUN mkdir -p /root && ln -s /home/syncmaster/.ivy2 /root/.ivy2
100+
RUN mkdir -p /root && ln -s /home/syncmaster/.ivy2 /root/.ivy2_packages
98101

99-
COPY --chmod=755 ./docker/entrypoint_worker.sh /app/entrypoint.sh
100102
COPY ./syncmaster/ /app/syncmaster/
101103
RUN python -m compileall /app/syncmaster
102-
ENTRYPOINT ["/app/entrypoint.sh"]
103104
# Do not run production as root, to improve security.
104105
# Also user does not own anything inside the image, including venv and source code.
105106
USER syncmaster
@@ -119,9 +120,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
119120
--group "test" \
120121
--compile-bytecode
121122

122-
COPY --chmod=755 ./docker/entrypoint_worker.sh /app/entrypoint.sh
123123
RUN sed -i 's/python -m/coverage run -m/g' /app/entrypoint.sh
124-
ENTRYPOINT ["/app/entrypoint.sh"]
125124

126125
# Replace kinit binary with dummy, to skip Kerberos interaction in tests
127126
RUN mkdir -p /app/.local/bin && \

0 commit comments

Comments
 (0)