-
Notifications
You must be signed in to change notification settings - Fork 21
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
Showing
3 changed files
with
14 additions
and
21 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,20 +1,13 @@ | ||
# pull official base image | ||
FROM docker.io/library/node:16.20.2-alpine3.18 | ||
|
||
RUN mkdir /app | ||
|
||
|
||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN yarn install | ||
RUN yarn add react-scripts | ||
ENV PATH="${PATH}:/app/node_modules/.bin/react-scripts" | ||
|
||
FROM node:18 | ||
# Create app directory | ||
WORKDIR /usr/src/cpt-dashboard | ||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
RUN npm install | ||
#To bundle your app’s source code inside the Docker image, use the COPY instruction: | ||
COPY . . | ||
#Your app binds to port 3000 so you’ll use the EXPOSE instruction to have it mapped by the docker daemon: | ||
EXPOSE 3000 | ||
|
||
RUN chown -R node /app | ||
USER node | ||
|
||
# start app | ||
CMD ["yarn", "run", "start"] | ||
CMD ["npm", "run", "dev"] |
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 |
---|---|---|
|
@@ -15,6 +15,6 @@ export default defineConfig({ | |
}, | ||
server: { | ||
port: 3000, | ||
open: true, | ||
open: false, | ||
}, | ||
}); |
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