Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
asrient committed Nov 18, 2023
1 parent 76ba37a commit da21e48
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
# Build stage
# =============================================================================

FROM node:18-alpine3.18 AS builder
FROM --platform=linux/amd64 node:18-alpine3.18 AS builder
LABEL authors="asrient"

WORKDIR /build

# Install app dependencies
# Copy source code
COPY web ./web
COPY apps ./apps

# Install dependencies and build
RUN cd web && npm ci && \
npm run build

Expand All @@ -20,13 +21,15 @@ RUN cd apps && npm ci && \
# ============================================================================= \
# Production stage
# =============================================================================
FROM node:18-alpine3.18
FROM --platform=linux/amd64 node:18-alpine3.18
LABEL authors="asrient"

WORKDIR /app

ENV NODE_ENV production
ENV PORT 5000

# Copy source code
COPY --from=builder /build/apps/bin/node ./bin/node
COPY --from=builder /build/web/out ./bin/web
COPY apps/package*.json ./
Expand All @@ -35,4 +38,5 @@ RUN npm ci --production

EXPOSE 5000

# Start the server
CMD ["node", "bin/node/index.js"]

0 comments on commit da21e48

Please sign in to comment.