Skip to content

Commit

Permalink
Fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor-Ultra committed Jun 27, 2023
1 parent d294e9f commit a9f9c43
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
FROM node:16
FROM node:lts-alpine3.16 as build-env

# Create app directory
WORKDIR /usr/src/app
WORKDIR /app

# Add required files
ADD packages /app/packages
ADD package.json /app/package.json
ADD package-lock.json /app/package-lock.json

# Install app dependencies
COPY package*.json ./
RUN npm ci
RUN npm install
RUN npm run build -ws


FROM node:lts-alpine3.16

# Bundle app source
COPY . .
WORKDIR /app
COPY --from=build-env /app/node_modules /app/node_modules
COPY --from=build-env /app/packages/server/dist /app/dist

# Expose express server port
EXPOSE 3000

# start the service
CMD bash -c "npm run start -ws"
ENTRYPOINT [ "node", "dist/index.js" ]

0 comments on commit a9f9c43

Please sign in to comment.