Skip to content
Snippets Groups Projects
Commit 81c9e3ee authored by ronick's avatar ronick
Browse files

init

parent 229fc278
Branches
No related tags found
No related merge requests found
# Use an official Vue.js runtime image as the base image # Use an official Node.js runtime as the base image
FROM node:14-slim as build FROM node:14
# Set the working directory in the container # Set the working directory in the container
WORKDIR /app WORKDIR /app
# Copy package.json and package-lock.json to the working directory # Copy the package.json and package-lock.json (or yarn.lock) files to the container
COPY package*.json ./ COPY package*.json ./
# Install project dependencies # Install app dependencies
RUN npm install RUN npm install
# Copy the rest of the application code to the container # Copy the rest of the application code to the container
COPY src/components . COPY . .
# Build the Vue.js application # Build the Vue.js app for production
RUN npm run build RUN npm run build
# Use a lightweight Nginx image to serve the built Vue.js app # Expose the port the app will run on (change this if necessary)
FROM nginx:1.21-alpine
# Copy the built app from the previous stage into the Nginx image
COPY --from=build /app/dist /usr/share/nginx/html
# Expose port for incoming HTTP traffic
EXPOSE 8081 EXPOSE 8081
# Start Nginx when the container starts # Set the startup command to serve the built app
CMD ["nginx", "-g", "daemon off;"] CMD ["npm", "run", "serve"]
...@@ -14,7 +14,7 @@ spec: ...@@ -14,7 +14,7 @@ spec:
spec: spec:
containers: containers:
- name: frontend - name: frontend
image: https://gitlab.univ-lille.fr/ronick.romulus.etu/vue/frontend-image:latest image: roromulus/vue:latest
ports: ports:
- containerPort: 8081 # Port your Vue.js app is running on - containerPort: 8081 # Port your Vue.js app is running on
env: env:
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vite",
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview" "preview": "vite preview"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment