forked from uc-cdis/mc2dp-data-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (30 loc) · 1023 Bytes
/
Dockerfile
File metadata and controls
37 lines (30 loc) · 1023 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
# docker build -t ff .
# docker run -p 3000:3000 -it ff
# Build stage
FROM node:22-slim AS builder
WORKDIR /gen3
COPY ./package.json ./package-lock.json ./next.config.js ./tsconfig.json ./.env.development ./tailwind.config.js ./postcss.config.js ./start.sh ./.env.production ./
RUN npm ci
COPY ./src ./src
COPY ./public ./public
COPY ./config ./config
COPY ./start.sh ./
RUN npm install @swc/core @napi-rs/magic-string && \
npm run build
# Production stage
FROM node:22-slim AS runner
WORKDIR /gen3
RUN addgroup --system --gid 1001 nextjs && \
adduser --system --uid 1001 nextjs
COPY --from=builder /gen3/package.json ./
COPY --from=builder /gen3/node_modules ./node_modules
COPY --from=builder /gen3/config ./config
COPY --from=builder /gen3/.next ./.next
COPY --from=builder /gen3/public ./public
COPY --from=builder /gen3/start.sh ./start.sh
RUN mkdir -p /gen3/.next/cache/images
RUN chmod -R 777 /gen3/.next/cache
RUN chown nextjs:nextjs /gen3/.next
USER nextjs:nextjs
ENV PORT=3000
CMD bash ./start.sh