Change Dockerfile

This commit is contained in:
Ryan Pandya 2023-05-16 16:04:57 -04:00
parent ffa4758e45
commit 20a70652dd

View File

@ -1,24 +1,25 @@
FROM node:16 FROM node:16
# Export static site into lifetracker-server
WORKDIR lifetracker-vue
RUN npm install
RUN npm run build-only
# Create app directory # Create app directory
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Export static site into lifetracker-server
COPY lifetracker-vue/ ./
WORKDIR /usr/src/app/lifetracker-vue
RUN npm install
RUN npm run build-only
WORKDIR /usr/src/app/lifetracker-server
# Install app dependencies # Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied # A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+) # where available (npm@5+)
COPY lifetracker-server/package*.json ./ COPY lifetracker-server/ ./
RUN npm install RUN npm install
# If you are building your code for production # If you are building your code for production
# RUN npm ci --omit=dev # RUN npm ci --omit=dev
# Bundle app source WORKDIR /usr/src/app/lifetracker-server
COPY lifetracker-server .
EXPOSE 8081 EXPOSE 8081
CMD [ "npm", "start" ] CMD [ "npm", "start" ]