-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (33 loc) · 910 Bytes
/
Copy pathDockerfile
File metadata and controls
46 lines (33 loc) · 910 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
39
40
41
42
43
44
45
46
# Build stage
FROM node:16-alpine as builder
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json yarn.lock ./
# Install dependencies
RUN yarn install --frozen-lockfile
# Copy project files
COPY . .
# Build the application
RUN yarn build
# Production stage
FROM node:16-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json yarn.lock ./
# Install production dependencies only
RUN yarn install --production --frozen-lockfile
# Copy built application and necessary files from builder stage
COPY --from=builder /app/.nuxt ./.nuxt
COPY --from=builder /app/nuxt.config.js ./
COPY --from=builder /app/static ./static
COPY --from=builder /app/api ./api
COPY --from=builder /app/package.json ./
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
# Expose the port the app runs on
EXPOSE 3000
# Start the application
CMD ["yarn", "start"]