Adding new Dockerfile

This commit is contained in:
Benjamin
2024-11-22 09:23:43 +01:00
parent 198c5ccd5c
commit a10982edf7
2 changed files with 17 additions and 16 deletions

View File

@@ -1,36 +1,39 @@
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
# This stage is used when running from VS in fast mode (Default for Debug configuration)
# Base image for runtime
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
# This stage is used to build the service project
# Build stage for ASP.NET Core
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["pointMaster/pointMaster.csproj", "pointMaster/"]
RUN dotnet restore "./pointMaster/pointMaster.csproj"
COPY . .
WORKDIR "/src/pointMaster"
COPY ["pointMaster.csproj", "./"]
RUN dotnet restore "./pointMaster.csproj"
COPY . .
WORKDIR "/src"
RUN dotnet build "./pointMaster.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM node:20 AS node-build
# Build stage for Vue.js app
FROM node:18 AS node-build
WORKDIR /js-app
COPY ["js/package.json", "js/package-lock.json*", "./"]
RUN npm install
COPY js/ .
RUN npm run build
RUN ls -la /js-app
RUN ls -la /wwwroot/js/dist
# This stage is used to publish the service project to be copied to the final stage
# Publish ASP.NET Core app
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./pointMaster.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
# Copy Vue.js build output to ASP.NET Core wwwroot
COPY --from=node-build /wwwroot/js/dist /app/publish/wwwroot/js/dist
# Final runtime stage
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .

View File

@@ -12,13 +12,11 @@
"license": "ISC",
"dependencies": {
"@vue/cli-plugin-typescript": "^5.0.8",
"@vue/cli-service": "^5.0.8",
"apexcharts": "^4.0.0",
"axios": "^1.7.7",
"vue": "^3.5.13",
"vue-class-component": "^7.2.6"
"vue": "^3.5.13"
},
"devDependencies": {
"vue-cli-service": "^5.0.10"
"@vue/cli-service": "^5.0.8"
}
}