Skip to content

Commit

Permalink
adds a dockerfile and a build action
Browse files Browse the repository at this point in the history
  • Loading branch information
liamlaverty committed Feb 1, 2024
1 parent 6801d0b commit 5f6884e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/docker-build-umbraco-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Docker Build Umbraco Image

on:
push:
branches: [ "main", "stage", "develop" ]
pull_request:
branches: [ "main", "develop" ]

jobs:
build-umbraco-container:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build Umbraco Docker image
run: docker build . --file ./Dockerfile --tag my-image-name:$(date +%s)
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# syntax=docker/dockerfile:1

FROM mcr.microsoft.com/dotnet/sdk:8.0 as build-env
WORKDIR /src
COPY ["ContainerRegistryTest/ContainerRegistryTest.csproj", "."]

RUN dotnet restore
COPY . .
RUN dotnet publish ContainerRegistryTest/ContainerRegistryTest.csproj --configuration Release --output /publish

FROM mcr.microsoft.com/dotnet/sdk:8.0 as runtime-env
WORKDIR /publish
COPY --from=build-env /publish .
ENV ASPNETCORE_URLS "http://+:80"
EXPOSE 80
ENTRYPOINT [ "dotnet", "ContainerRegistryTest.dll"]

0 comments on commit 5f6884e

Please sign in to comment.