Skip to content

Commit 168174c

Browse files
committed
Move Dockerfile and try isolated build
1 parent a0358e3 commit 168174c

3 files changed

Lines changed: 26 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ jobs:
99
- name: checkout
1010
uses: actions/checkout@v2
1111

12-
- name: dotnet publish
13-
run: |
14-
rm -rf publish
15-
dotnet publish ./RazorTemplate/ -o publish -c release -r linux-x64
16-
cd publish && ls -l && cd ..
17-
1812
- name: repository name fix
1913
run: echo "image_repository_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
2014

@@ -28,7 +22,7 @@ jobs:
2822
- name: Build and push Docker images
2923
uses: docker/build-push-action@v2.2.2
3024
with:
31-
file: RazorTemplate/Dockerfile
25+
file: Dockerfile
3226
context: .
3327
push: true
3428
tags: ghcr.io/${{ env.image_repository_name }}:${{ github.event.release.tag_name }}

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
2+
WORKDIR /source
3+
4+
ENV NODE_VERSION=12.6.0
5+
RUN apt install -y curl
6+
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
7+
ENV NVM_DIR=/root/.nvm
8+
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
9+
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
10+
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
11+
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
12+
RUN node --version
13+
RUN npm --version
14+
RUN npm install -g typescript
15+
COPY . .
16+
RUN dotnet restore
17+
18+
WORKDIR /source/RazorTemplate
19+
RUN dotnet publish -c release -o /app --no-restore
20+
21+
22+
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
23+
WORKDIR /app
24+
COPY --from=build /app ./
25+
ENTRYPOINT ["dotnet", "RazorTemplate.dll"]

RazorTemplate/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)