Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
ZOXEXIVO committed Feb 19, 2023
1 parent 2de0088 commit 8201951
Show file tree
Hide file tree
Showing 5 changed files with 5,616 additions and 6,864 deletions.
12 changes: 1 addition & 11 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,8 @@ kind: pipeline
name: default

steps:
- name: build_frontend
image: docker:latest
depends_on: [ clone ]
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker build --no-cache -t geen-frontend:2.0.0.$$DRONE_BUILD_NUMBER -f "build/Frontend.Dockerfile" .

- name: build_web
image: docker:latest
depends_on: [ build_frontend ]
volumes:
- name: docker_sock
path: /var/run/docker.sock
Expand Down Expand Up @@ -52,7 +42,7 @@ steps:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker run -d -p 172.17.0.1:7000:7000 --volume /home/zoxexivo/static/htmls:/html/geen --restart always --name geen-web geen-web:2.0.0.$$DRONE_BUILD_NUMBER
- docker run -d -p 172.17.0.1:7000:7000 --restart always --name geen-web geen-web:2.0.0.$$DRONE_BUILD_NUMBER
- docker run -d --restart always --name geen-jobs geen-jobs:2.0.0.$$DRONE_BUILD_NUMBER

volumes:
Expand Down
11 changes: 0 additions & 11 deletions build/Frontend.Dockerfile

This file was deleted.

21 changes: 17 additions & 4 deletions build/Web.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
FROM node:17-alpine3.14 AS build-frontend

WORKDIR /app

COPY ./src/Frontend/package.json .

RUN npm install --legacy-peer-deps

COPY ./src/Frontend/ .

RUN npm run build

ARG BUILD_NUMBER

FROM geen-frontend:$BUILD_NUMBER as frontend

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-backend

WORKDIR /app

COPY ./src/Backend/ ./

WORKDIR /app/Geen.Web

COPY --from=frontend /app/dist wwwroot

RUN dotnet publish -c Release -o /app/out -r linux-x64 --self-contained true /p:PublishReadyToRun=true /p:PublishSingleFile=true --packages packages

FROM mcr.microsoft.com/dotnet/runtime-deps:7.0 AS runtime
WORKDIR /app
COPY --from=build /app/out .

COPY --from=build-backend /app/out .
COPY --build-frontend=frontend /app/dist wwwroot

ENTRYPOINT ["./Geen.Web"]
1 change: 0 additions & 1 deletion src/Backend/Geen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{91552B37-1D7C-4556-B5B2-65E6055C595F}"
ProjectSection(SolutionItems) = preProject
..\..\build\Web.Dockerfile = ..\..\build\Web.Dockerfile
..\..\build\Frontend.Dockerfile = ..\..\build\Frontend.Dockerfile
..\..\build\Jobs.Dockerfile = ..\..\build\Jobs.Dockerfile
EndProjectSection
EndProject
Expand Down
Loading

0 comments on commit 8201951

Please sign in to comment.