Skip to content

Commit

Permalink
Dockerfile update
Browse files Browse the repository at this point in the history
  • Loading branch information
MVarshini committed Apr 12, 2024
1 parent 7f78e17 commit c6004dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
31 changes: 12 additions & 19 deletions frontend/frontend.containerfile
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"]
2 changes: 1 addition & 1 deletion frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export default defineConfig({
},
server: {
port: 3000,
open: true,
open: false,
},
});
2 changes: 1 addition & 1 deletion local-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ podman build -f frontend/frontend.containerfile --tag frontend

podman run -d --name=back -p 8000:8000 -v "$PWD/backend/ocpperf.toml:/backend/ocpperf.toml:Z" localhost/backend

podman run -d --name=front -p 3000:3000 localhost/frontend
podman run -d --name=front --net=host -p 3000:3000 localhost/frontend

0 comments on commit c6004dd

Please sign in to comment.