-
Notifications
You must be signed in to change notification settings - Fork 0
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
f6fea4c
commit 1fde383
Showing
2 changed files
with
14 additions
and
29 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,36 +1,20 @@ | ||
## build runner | ||
FROM node:lts-alpine as build-runner | ||
## We install nodejs in order to run the application | ||
FROM node:lts-alpine | ||
|
||
# Set temp directory | ||
WORKDIR /tmp/app | ||
## Create the folder for the application | ||
WORKDIR /app | ||
|
||
# Move package.json | ||
COPY package.json . | ||
## Copy the package.json in order to install the necessary dependencies | ||
COPY ./package.json . | ||
|
||
# Install dependencies | ||
## We install the dependencies | ||
RUN npm install | ||
|
||
# Move source files | ||
COPY src ./src | ||
COPY tsconfig.json . | ||
|
||
# Build project | ||
RUN npm run build | ||
|
||
# Production runner | ||
FROM node:lts-alpine as prod-runner | ||
|
||
# Set work directory | ||
WORKDIR /app | ||
|
||
# Copy package.json from build-runner | ||
COPY --from=build-runner /tmp/app/package.json /app/package.json | ||
|
||
# Install dependencies | ||
RUN npm install --only=production | ||
## Copy everything to the application | ||
COPY . /app | ||
|
||
# Move build files | ||
COPY --from=build-runner /tmp/app/build /app/build | ||
## Expose the port | ||
EXPOSE 3000 | ||
|
||
# Start bot | ||
CMD [ "node", "build/index.js" ] | ||
## Run the application | ||
CMD npm run start |
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
1fde383
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-boilerplate – ./
react-boilerplate-psi.vercel.app
react-boilerplate-jd-apprentice.vercel.app
react-boilerplate-git-master-jd-apprentice.vercel.app