-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathDockerfile.app
More file actions
38 lines (26 loc) · 892 Bytes
/
Dockerfile.app
File metadata and controls
38 lines (26 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Application image that uses the cached base image
ARG BASE_IMAGE
FROM node AS npm
WORKDIR /tmp
# Copy package files (should already be cached in base image)
COPY package.json package-lock.json /tmp/
# Install dependencies (this layer should be cached from base image build)
RUN npm update -g npm && npm install
# Copy application code and build frontend assets
COPY . /tmp/
RUN npm run build
# -----------------------------------------------------------------------------
# Use the cached base image
FROM ${BASE_IMAGE}
# Switch to root temporarily to copy files
USER root
# Copy application code
COPY . /app/
# Copy built frontend assets from the npm stage
COPY --from=npm /tmp/jazzband/static/dist /app/jazzband/static/dist/
# Ensure proper ownership
RUN chown -R 10001:10001 /app
# Switch back to app user
USER 10001
EXPOSE 5000
ENTRYPOINT ["/app/docker-entrypoint.sh", "--"]