Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile and associated files #9

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions Dockerfile

This file was deleted.

18 changes: 18 additions & 0 deletions docker/Dockerfile
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
11 changes: 11 additions & 0 deletions docker/docker-compose.yml
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.