forked from dexter21767/Trakt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
49 lines (36 loc) · 1.04 KB
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
47
48
49
# Multi-stage build for efficiency
FROM node:18-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY vue/package*.json ./vue/
# Install all dependencies (both prod & dev)
RUN npm ci
# Install Vue dependencies separately for layer caching
WORKDIR /app/vue
RUN npm ci
# Copy all source files
WORKDIR /app
COPY . .
# Build application
RUN npm run Build
# Production stage
FROM node:18-alpine
WORKDIR /app
# Copy package files and production dependencies
COPY package*.json ./
RUN npm ci --omit=dev
# Copy built Vue app from builder
COPY --from=builder /app/vue/dist ./vue/dist
COPY --from=builder /app/vue/node_modules ./vue/node_modules
COPY --from=builder /app/vue/assets ./vue/assets
COPY --from=builder /app/vue/public ./vue/public
# Copy server source code
COPY --from=builder /app/*.js ./
COPY --from=builder /app/sortOpts.json ./
COPY --from=builder /app/swagger-specs.json ./
COPY --from=builder /app/node_modules ./node_modules
# Expose the port your app runs on
EXPOSE 63355
# Start the application
CMD ["npm", "start"]