-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d294e9f
commit a9f9c43
Showing
1 changed file
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |