Modification in Dockerfile to remove the necessity to have a persistent folder on the docker host. Also added modification in docker-compose file to reflect the Dockerfile changes.
This commit is contained in:
parent
00bc56ea61
commit
73a371ae49
34
Dockerfile
34
Dockerfile
|
|
@ -1,28 +1,20 @@
|
|||
# targo-frontend
|
||||
FROM node:22
|
||||
|
||||
# Set working directory inside container
|
||||
# Step 1 - Building the app
|
||||
FROM node:22 AS build
|
||||
WORKDIR /app
|
||||
|
||||
# Adding Quasar
|
||||
RUN yarn global add @quasar/cli
|
||||
|
||||
COPY package*.json ./
|
||||
# Set environment variables
|
||||
ARG BACKEND_URL
|
||||
ENV VITE_TARGO_BACKEND_URL=$BACKEND_URL
|
||||
|
||||
# Copy the code
|
||||
COPY . .
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install -g @quasar/cli
|
||||
COPY . .
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
# Linting and formating
|
||||
RUN yarn
|
||||
RUN yarn lint
|
||||
|
||||
# Expose Quasar dev port
|
||||
EXPOSE 9000
|
||||
|
||||
# Default command
|
||||
CMD ["npm", "run", "dev"]
|
||||
# Step 2 - Move Applicatin to Nginx
|
||||
FROM nginx:alpine
|
||||
COPY --from=build /app/dist/spa /usr/share/nginx/html
|
||||
RUN mkdir /usr/share/nginx/html/src
|
||||
COPY --from=build /app/src /usr/share/nginx/html/src
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
|
@ -23,4 +23,4 @@ services:
|
|||
env_file:
|
||||
- stack.env
|
||||
ports:
|
||||
- ${FRONTEND_PUBLIC_PORT}:9000
|
||||
- ${FRONTEND_PUBLIC_PORT}:80
|
||||
Loading…
Reference in New Issue
Block a user