This repository has been archived by the owner on Dec 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from DFE-Digital/docker
Add Dockerfile and associated files
- Loading branch information
Showing
4 changed files
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG ASPNET_IMAGE_TAG=7.0-bullseye-slim-amd64 | ||
ARG DOTNET_SDK=7.0 | ||
|
||
# Stage 2 - Build and publish dotnet application | ||
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_SDK} AS publish | ||
COPY . . | ||
RUN dotnet restore DfE.IdentifiersApi | ||
RUN dotnet build DfE.IdentifiersApi -c Release | ||
RUN dotnet publish DfE.IdentifiersApi -c Release -o /app --no-build | ||
|
||
COPY ./docker/docker-entrypoint.sh /app/docker-entrypoint.sh | ||
|
||
# Stage 3 - Put into Docker container that will actually be run | ||
FROM mcr.microsoft.com/dotnet/aspnet:${ASPNET_IMAGE_TAG} AS final | ||
COPY --from=publish /app /app | ||
WORKDIR /app | ||
RUN chmod +x ./docker-entrypoint.sh | ||
EXPOSE 80/tcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3.8" | ||
services: | ||
webapp: | ||
build: | ||
context: .. | ||
dockerfile: docker/Dockerfile | ||
command: /bin/bash -c "./docker-entrypoint.sh dotnet DfE.IdentifiersApi.dll" | ||
ports: | ||
- 80:80/tcp | ||
env_file: | ||
- .env |
File renamed without changes.