feat: add Dockerfiles for frontend and backend, and a Gitea workflow for building and pushing images.
Build & Push Hospitality / build-and-push (push) Failing after 7s
Build & Push Hospitality / build-and-push (push) Failing after 7s
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# --- Build stage ---
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Kopier alt
|
||||
COPY . .
|
||||
|
||||
# Publiser i Release
|
||||
RUN dotnet publish "Hospitality.Backend.csproj" -c Release -o /app/publish
|
||||
|
||||
# --- Runtime stage ---
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
||||
WORKDIR /app
|
||||
|
||||
# Kopier publisert output
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
# Appen lytter standard til ASPNETCORE_URLS
|
||||
EXPOSE 8080
|
||||
ENV ASPNETCORE_URLS=http://0.0.0.0:8080
|
||||
|
||||
ENTRYPOINT ["dotnet", "Hospitality.Backend.dll"]
|
||||
@@ -0,0 +1,23 @@
|
||||
# --- Build stage ---
|
||||
FROM node:22 AS build
|
||||
WORKDIR /app
|
||||
|
||||
# Installer dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Kopier resten av koden
|
||||
COPY . .
|
||||
|
||||
# Bygg for produksjon
|
||||
RUN npm run build
|
||||
|
||||
# --- Runtime stage ---
|
||||
FROM nginx:alpine
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
# Legg inn bygget frontend
|
||||
COPY --from=build /app/dist .
|
||||
|
||||
# Nginx server som statisk side
|
||||
EXPOSE 80
|
||||
Reference in New Issue
Block a user