Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from DFE-Digital/docker
Browse files Browse the repository at this point in the history
Add Dockerfile and associated files
  • Loading branch information
DrizzlyOwl authored Mar 22, 2024
2 parents e3a3bfe + 8a8db07 commit b655fc7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
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.

0 comments on commit b655fc7

Please sign in to comment.