-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (30 loc) · 800 Bytes
/
Dockerfile
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
# Base image
FROM node:20-alpine as builder
# Set working directory
WORKDIR /usr/src/app
# Copy package files
COPY package.json package-lock.json ./
# Install ALL dependencies (including dev dependencies)
RUN npm ci
# Copy application files
COPY . .
# Build Remix app
RUN npm run build
# Production image
FROM node:20-alpine
# Set working directory
WORKDIR /usr/src/app
# Set NODE_ENV to production
ENV NODE_ENV=production
# Copy package files
COPY package.json package-lock.json ./
# Install only production dependencies
RUN npm ci --only=production
# Copy server file and other necessary files
COPY server.js ./
COPY --from=builder /usr/src/app/build ./build
COPY --from=builder /usr/src/app/public ./public
# Expose Remix's port
EXPOSE 3000
# Start the Remix app
CMD ["npm", "start"]