mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: add health checks for backend and frontend services in docker-compose.yml
This commit is contained in:
@@ -9,5 +9,6 @@ RUN npm run build
|
|||||||
FROM node:20-alpine as runner
|
FROM node:20-alpine as runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app .
|
COPY --from=build /app .
|
||||||
|
RUN apk add --no-cache wget
|
||||||
EXPOSE 5173
|
EXPOSE 5173
|
||||||
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "5173"]
|
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "5173"]
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ RUN dotnet publish SharpbinV3.Server.csproj -c Release -o /app/out
|
|||||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/out .
|
COPY --from=build /app/out .
|
||||||
|
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/*
|
||||||
|
ENV ASPNETCORE_URLS=http://+:8080
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
ENTRYPOINT ["dotnet", "SharpbinV3.Server.dll"]
|
ENTRYPOINT ["dotnet", "SharpbinV3.Server.dll"]
|
||||||
|
|||||||
+12
-2
@@ -14,8 +14,12 @@ services:
|
|||||||
- ./SharpbinV3.Server/appsettings.json:/app/appsettings.json
|
- ./SharpbinV3.Server/appsettings.json:/app/appsettings.json
|
||||||
networks:
|
networks:
|
||||||
- sharpbin-net
|
- sharpbin-net
|
||||||
expose:
|
healthcheck:
|
||||||
- "8080"
|
test: 'wget --no-verbose --spider http://localhost:8080/health || exit 1'
|
||||||
|
interval: 30s
|
||||||
|
timeout: 30s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
@@ -30,6 +34,12 @@ services:
|
|||||||
- "5173:5173"
|
- "5173:5173"
|
||||||
networks:
|
networks:
|
||||||
- sharpbin-net
|
- sharpbin-net
|
||||||
|
healthcheck:
|
||||||
|
test: 'wget --no-verbose --spider http://localhost:5173/health || exit 1'
|
||||||
|
interval: 30s
|
||||||
|
timeout: 30s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user