forked from threesigmaxyz/filecoin-plus-frontend
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (23 loc) · 812 Bytes
/
Dockerfile
File metadata and controls
40 lines (23 loc) · 812 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
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
# Accept build argument for environment only
ARG NEXT_PUBLIC_APP_ENVIRONMENT
# Set the environment variable during build
ENV NEXT_PUBLIC_APP_ENVIRONMENT=${NEXT_PUBLIC_APP_ENVIRONMENT:-production}
RUN npm run build
# Production Stage
FROM node:18-alpine AS production
# Accept build argument for environment in production stage too
ARG NEXT_PUBLIC_APP_ENVIRONMENT
WORKDIR /app
# Copy the built artifacts from the builder stage
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
# Set only the essential environment variables
ENV NODE_ENV=production
ENV NEXT_PUBLIC_APP_ENVIRONMENT=${NEXT_PUBLIC_APP_ENVIRONMENT:-production}
EXPOSE 3000
CMD ["node", "server.js"]