Skip to content

Commit 3c2cb25

Browse files
authored
reorder dockerfile to better facilitate layer reuse (#257)
1 parent 065df59 commit 3c2cb25

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

docker/Dockerfile.registry

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2222

2323
WORKDIR /app
2424

25-
# Copy the application code
26-
COPY . /app/
27-
28-
# Copy nginx configurations (both HTTP-only and HTTP+HTTPS versions)
29-
COPY docker/nginx_rev_proxy_http_only.conf /app/docker/nginx_rev_proxy_http_only.conf
30-
COPY docker/nginx_rev_proxy_http_and_https.conf /app/docker/nginx_rev_proxy_http_and_https.conf
31-
32-
# Build React frontend
33-
WORKDIR /app/frontend
34-
COPY frontend/package.json ./
35-
RUN npm install --legacy-peer-deps
36-
COPY frontend/ ./
37-
RUN npm run build
38-
39-
# Return to app directory
40-
WORKDIR /app
41-
42-
# Install uv and setup Python environment
4325
RUN pip install uv && \
4426
uv venv .venv --python 3.12 && \
4527
. .venv/bin/activate && \
@@ -59,8 +41,27 @@ RUN pip install uv && \
5941
"scikit-learn>=1.3.0" \
6042
"torch>=1.6.0" \
6143
"huggingface-hub[cli,hf_xet]>=0.31.1" \
62-
"hf_xet>=0.1.0" && \
63-
uv pip install -e .
44+
"hf_xet>=0.1.0"
45+
46+
# Copy the application code
47+
COPY . /app/
48+
49+
# Copy nginx configurations (both HTTP-only and HTTP+HTTPS versions)
50+
COPY docker/nginx_rev_proxy_http_only.conf /app/docker/nginx_rev_proxy_http_only.conf
51+
COPY docker/nginx_rev_proxy_http_and_https.conf /app/docker/nginx_rev_proxy_http_and_https.conf
52+
53+
# Build React frontend
54+
WORKDIR /app/frontend
55+
COPY frontend/package.json ./
56+
RUN npm install --legacy-peer-deps
57+
COPY frontend/ ./
58+
RUN npm run build
59+
60+
# Return to app directory
61+
WORKDIR /app
62+
63+
# Install uv and setup Python environment
64+
RUN . .venv/bin/activate && uv pip install -e .
6465

6566
# Create logs directory
6667
RUN mkdir -p /app/logs

0 commit comments

Comments
 (0)