Skip to content

Commit

Permalink
Docker improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
calebsmithdev committed Feb 10, 2024
1 parent e90dd9a commit 34f4127
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
# Dockerfile
FROM node:20-alpine3.17
FROM node:20-alpine as builder

WORKDIR /app

COPY package*.json ./
COPY package.json /app/
COPY package-lock.json /app/

RUN npm install
ADD . /app
RUN npm run build

# start final image
FROM node:20-alpine

COPY . .
WORKDIR /app

# copy over build files from builder step
COPY --from=builder /app/.output app/.output
COPY --from=builder /app/.nuxt app/.nuxt

# expose the host and port 3000 to the server
ENV HOST 0.0.0.0
EXPOSE 3000

RUN npm run build
CMD [ "npm", "run", "start" ]

0 comments on commit 34f4127

Please sign in to comment.