Petit update Docker

This commit is contained in:
2026-01-22 11:13:33 +01:00
parent dbde9eaff4
commit ddec0f7502
3 changed files with 11 additions and 17 deletions

View File

@@ -2,15 +2,17 @@
# Use the official Microsoft ASP.NET Core image to build the backend # Use the official Microsoft ASP.NET Core image to build the backend
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-backend FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-backend
WORKDIR "/src/backend" WORKDIR /src/backend
COPY Back/ . COPY Back .
RUN dotnet restore "skydiveLogs-api/skydiveLogs-api.csproj" RUN dotnet restore skydiveLogs-api/skydiveLogs-api.csproj
RUN dotnet publish "skydiveLogs-api/skydiveLogs-api.csproj" -c Release -o /app/publish RUN dotnet publish skydiveLogs-api/skydiveLogs-api.csproj -c Release -o /app/publish
# Use the official node image to build the Angular app # Use the official node image to build the Angular app
FROM node:22-alpine AS build-frontend FROM node:22-alpine AS build-frontend
WORKDIR /app WORKDIR /app
COPY ["Front/skydivelogs-app/package.json", "Front/skydivelogs-app/package-lock.json*", "./"] # COPY ["../Front/skydivelogs-app/package.json", "../Front/skydivelogs-app/package-lock.json*", "./"]
COPY Front/skydivelogs-app/package.json .
COPY Front/skydivelogs-app/package-lock.json .
RUN npm install RUN npm install
COPY --exclude=Front/skydivelogs-app/node_modules/* Front/skydivelogs-app/ . COPY --exclude=Front/skydivelogs-app/node_modules/* Front/skydivelogs-app/ .
RUN npm run build RUN npm run build
@@ -21,11 +23,9 @@ WORKDIR /app
# Install nginx # Install nginx
RUN apt-get update && apt-get install -y nginx curl && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y nginx curl && rm -rf /var/lib/apt/lists/*
# Copy custom nginx configuration # Copy custom nginx configuration
COPY nginx.conf /etc/nginx/sites-available/default COPY nginx.conf /etc/nginx/sites-available/default
RUN rm -rf /usr/share/nginx/html/* RUN rm -rf /usr/share/nginx/html/*
# Copy frontend dist folder to nginx html directory # Copy frontend dist folder to nginx html directory
COPY --from=build-frontend --exclude=/app/dist/browser/config/* /app/dist/browser /usr/share/nginx/html COPY --from=build-frontend --exclude=/app/dist/browser/config/* /app/dist/browser /usr/share/nginx/html
RUN mkdir -p /usr/share/nginx/html/config RUN mkdir -p /usr/share/nginx/html/config

View File

@@ -1,7 +1,7 @@
To build an image "toto" with the version "0.1": podman build . -t skydivelogs:1.5.0 To build an image "toto" with the version "0.1": podman build . -t skydivelogs:1.5.5
To run ab image to container with volume : To run ab image to container with volume :
podman run -v C:\toto\config:/app/Front/config -v C:\toto\db:/app/API/Data -d -p 5080:80/tcp --name Test -it skydivelogs:1.5.0 podman run -v C:\toto\config:/app/Front/config -v C:\toto\db:/app/API/Data -d -p 5080:80/tcp --name Test -it skydivelogs:1.5.5
podman save --output skydivelogs-1.5.0.tar skydivelogs:1.5.0 podman save --output skydivelogs-1.5.5.tar skydivelogs:1.5.5
scp -P 5022 skydivelogs-1.5.0.tar administrator@51.75.68.58:~ scp -P 5022 skydivelogs-1.5.5.tar administrator@51.75.68.58:~

View File

@@ -1,6 +0,0 @@
#!/bin/sh
service nginx start
cd /app/API/
dotnet skydiveLogs-api.dll