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
|
# Step 1 - Building the app
|
||||||
FROM node:22
|
FROM node:22 AS build
|
||||||
|
|
||||||
# Set working directory inside container
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
# Adding Quasar
|
|
||||||
RUN yarn global add @quasar/cli
|
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ARG BACKEND_URL
|
ARG BACKEND_URL
|
||||||
ENV VITE_TARGO_BACKEND_URL=$BACKEND_URL
|
ENV VITE_TARGO_BACKEND_URL=$BACKEND_URL
|
||||||
|
|
||||||
# Copy the code
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
|
RUN npm install -g @quasar/cli
|
||||||
|
COPY . .
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
# Linting and formating
|
# Step 2 - Move Applicatin to Nginx
|
||||||
RUN yarn
|
FROM nginx:alpine
|
||||||
RUN yarn lint
|
COPY --from=build /app/dist/spa /usr/share/nginx/html
|
||||||
|
RUN mkdir /usr/share/nginx/html/src
|
||||||
# Expose Quasar dev port
|
COPY --from=build /app/src /usr/share/nginx/html/src
|
||||||
EXPOSE 9000
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
# Default command
|
|
||||||
CMD ["npm", "run", "dev"]
|
|
||||||
|
|
@ -23,4 +23,4 @@ services:
|
||||||
env_file:
|
env_file:
|
||||||
- stack.env
|
- stack.env
|
||||||
ports:
|
ports:
|
||||||
- ${FRONTEND_PUBLIC_PORT}:9000
|
- ${FRONTEND_PUBLIC_PORT}:80
|
||||||
Loading…
Reference in New Issue
Block a user