Update avec le Container qui compile et publish
This commit is contained in:
90
Dockerfile
90
Dockerfile
@@ -1,74 +1,78 @@
|
||||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0.16-bookworm-slim-amd64 AS base
|
||||
EXPOSE 80
|
||||
# FROM mcr.microsoft.com/dotnet/aspnet:8.0.16-bookworm-slim-amd64 AS base
|
||||
# EXPOSE 80
|
||||
|
||||
RUN apt-get -y update
|
||||
RUN apt-get -y install nginx
|
||||
# RUN apt-get -y update
|
||||
# RUN apt-get -y install nginx
|
||||
|
||||
RUN mkdir -p /app/Front /app/API
|
||||
# RUN mkdir -p /app/Front /app/API
|
||||
|
||||
COPY Front/skydivelogs-app/dist /app/Front
|
||||
COPY Back/dist /app/API
|
||||
# COPY Front/skydivelogs-app/dist /app/Front
|
||||
# COPY Back/dist /app/API
|
||||
|
||||
RUN rm -f /app/startup.sh
|
||||
COPY startup.sh /app
|
||||
RUN chmod 755 /app/startup.sh
|
||||
# RUN rm -f /app/startup.sh
|
||||
# COPY startup.sh /app
|
||||
# RUN chmod 755 /app/startup.sh
|
||||
|
||||
RUN update-rc.d nginx defaults
|
||||
COPY nginx.conf /etc/nginx/sites-available/default
|
||||
# CMD ["service" "nginx" "start;"]
|
||||
# RUN service nginx restart
|
||||
# RUN update-rc.d nginx defaults
|
||||
# COPY nginx.conf /etc/nginx/sites-available/default
|
||||
|
||||
VOLUME /app/API/Data
|
||||
VOLUME /app/Front/config
|
||||
# VOLUME /app/API/Data
|
||||
# VOLUME /app/Front/config
|
||||
|
||||
ENV ASPNETCORE_URLS http://+:5001
|
||||
# ENV ASPNETCORE_URLS http://+:5001
|
||||
|
||||
# WORKDIR /app/API
|
||||
# ENTRYPOINT ["dotnet", "skydiveLogs-api.dll"]
|
||||
ENTRYPOINT ["sh", "/app/startup.sh"]
|
||||
# CMD ["sh", "/app/startup.sh"]
|
||||
# ENTRYPOINT ["sh", "/app/startup.sh"]
|
||||
|
||||
|
||||
|
||||
|
||||
# Use the official Microsoft ASP.NET Core image to build the backend
|
||||
#FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-backend
|
||||
#WORKDIR /src
|
||||
#COPY ["api/AzureSpeed/AzureSpeed.csproj", "backend/"]
|
||||
#RUN dotnet restore "backend/AzureSpeed.csproj"
|
||||
#COPY api/AzureSpeed/ backend/
|
||||
#WORKDIR "/src/backend"
|
||||
#RUN dotnet publish "AzureSpeed.csproj" -c Release -o /app/publish
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-backend
|
||||
# WORKDIR /src
|
||||
# COPY ["Back/skydiveLogs-api/skydiveLogs-api.csproj", "backend/"]
|
||||
# RUN dotnet restore "backend/skydiveLogs-api.csproj"
|
||||
WORKDIR "/src/backend"
|
||||
COPY Back/ .
|
||||
RUN dotnet restore "skydiveLogs-api/skydiveLogs-api.csproj"
|
||||
RUN dotnet publish "skydiveLogs-api/skydiveLogs-api.csproj" -c Release -o /app/publish
|
||||
|
||||
# Use the official node image to build the Angular app
|
||||
#FROM node:20-alpine AS build-frontend
|
||||
#WORKDIR /app
|
||||
#COPY ["ui/package.json", "ui/package-lock.json*", "./"]
|
||||
#RUN npm install
|
||||
#COPY ui/ .
|
||||
#RUN npm run build
|
||||
FROM node:20-alpine AS build-frontend
|
||||
WORKDIR /app
|
||||
COPY ["Front/skydivelogs-app/package.json", "Front/skydivelogs-app/package-lock.json*", "./"]
|
||||
RUN npm install
|
||||
COPY Front/skydivelogs-app/ .
|
||||
RUN npm run build
|
||||
|
||||
# Use a .NET runtime image to serve both the backend and frontend
|
||||
#FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
||||
#WORKDIR /app
|
||||
# FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0.16-bookworm-slim-amd64 AS final
|
||||
WORKDIR /app
|
||||
|
||||
# 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 nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
#RUN rm -rf /usr/share/nginx/html/*
|
||||
#COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY nginx.conf /etc/nginx/sites-available/default
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# Copy frontend dist folder to nginx html directory
|
||||
#COPY --from=build-frontend /app/dist/azure-speed-test/browser /usr/share/nginx/html
|
||||
COPY --from=build-frontend /app/dist /usr/share/nginx/html
|
||||
# COPY --from=build-frontend /app/dist/azure-speed-test/browser /usr/share/nginx/html
|
||||
|
||||
# Copy backend from the correct build stage
|
||||
#COPY --from=build-backend /app/publish /app
|
||||
COPY --from=build-backend /app/publish /app
|
||||
|
||||
# Expose port 80 for the application
|
||||
#EXPOSE 80
|
||||
EXPOSE 80
|
||||
|
||||
ENV ASPNETCORE_URLS http://+:5001
|
||||
|
||||
VOLUME /app/Data
|
||||
VOLUME /usr/share/nginx/html/config
|
||||
|
||||
# Start nginx and the .NET Core app
|
||||
#CMD ["sh", "-c", "dotnet /app/AzureSpeed.dll & nginx -g 'daemon off;'"]
|
||||
CMD ["sh", "-c", "dotnet /app/skydiveLogs-api.dll & nginx -g 'daemon off;'"]
|
||||
11
TODO.md
11
TODO.md
@@ -1,11 +0,0 @@
|
||||
BACK :
|
||||
- JumpType :
|
||||
- ajouter l'indication que le type de saut est faisable en tunnel
|
||||
|
||||
FRONT :
|
||||
- JumpType :
|
||||
- ajouter dans la page un check-box pour indiquer que le type est faisable en tunnel
|
||||
- permettre de mettre à jour le type sur l'info "en tunnel"
|
||||
- Tunnel Flight
|
||||
- la liste de type de vol filter pour ceux concernant par le tunnel
|
||||
- avec juste 1 date
|
||||
@@ -4,7 +4,8 @@ server {
|
||||
|
||||
server_name _;
|
||||
|
||||
root /app/Front;
|
||||
#root /app/Front;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location /api {
|
||||
|
||||
Reference in New Issue
Block a user