Skip to content

Commit

Permalink
Test multi-stage Dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 28, 2023
1 parent 73b4420 commit 1a295a9
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy

SHELL ["/bin/bash", "-c"]

EXPOSE 5000

ENV ASPNETCORE_ENVIRONMENT="Production"
ENV ASPNETCORE_URLS="http://*:5000"
FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy AS setup

WORKDIR /src

Expand All @@ -18,6 +11,16 @@ RUN \
unzip -o ./Server.zip -d /app && \
rm ./Server.zip


FROM setup AS execute

SHELL ["/bin/bash", "-c"]

EXPOSE 5000

ENV ASPNETCORE_ENVIRONMENT="Production"
ENV ASPNETCORE_URLS="http://*:5000"

WORKDIR /app

RUN \
Expand All @@ -28,4 +31,7 @@ VOLUME "/remotely-data"

RUN chmod +x "/src/DockerMain.sh"

ENTRYPOINT ["/src/DockerMain.sh"]
ENTRYPOINT ["/src/DockerMain.sh"]

HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:5000/ || exit 1

0 comments on commit 1a295a9

Please sign in to comment.