Add Docker stuff
This commit is contained in:
parent
8f3ea03d75
commit
09cdc84367
2 changed files with 16 additions and 31 deletions
35
.drone.yml
35
.drone.yml
|
@ -4,38 +4,13 @@ name: default
|
|||
clone:
|
||||
skip_verify: true
|
||||
|
||||
volumes:
|
||||
- name: output
|
||||
host:
|
||||
path: /var/www/Api.Auth
|
||||
|
||||
steps:
|
||||
- name: build and publish
|
||||
image: mcr.microsoft.com/dotnet/core/sdk:3.1
|
||||
volumes:
|
||||
- name: output
|
||||
path: /output
|
||||
environment:
|
||||
ConnectionString:
|
||||
from_secret: ConnectionString
|
||||
commands:
|
||||
- chmod +x ./build.sh
|
||||
- ./build.sh
|
||||
- sed -i "s/<DatabaseConnectionString>/$ConnectionString/g" output/appsettings.json
|
||||
- cp api.auth.service output/
|
||||
- cp -r ./output/* /output
|
||||
- name: restart service
|
||||
privileged: true
|
||||
image: appleboy/drone-ssh
|
||||
- name: docker
|
||||
image: plugins/docker
|
||||
settings:
|
||||
host: 192.168.1.3
|
||||
username:
|
||||
from_secret: ssh_user
|
||||
password:
|
||||
from_secret: ssh_password
|
||||
script:
|
||||
- systemctl daemon-reload
|
||||
- service api.auth restart
|
||||
repo: docker.robware.uk/api.auth
|
||||
registry: docker.robware.uk
|
||||
tags: latest
|
||||
- name: notify
|
||||
image: drillster/drone-email
|
||||
settings:
|
||||
|
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build-env
|
||||
WORKDIR /app
|
||||
COPY . ./
|
||||
RUN ./build.sh
|
||||
RUN sed -i "s/<DatabaseConnectionString>/${ConnectionString}/g" output/appsettings.json
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:3.1
|
||||
WORKDIR /app
|
||||
COPY --from=build-env /app/output .
|
||||
ENTRYPOINT ["dotnet", "Robware.Api.Auth.dll"]
|
Loading…
Add table
Add a link
Reference in a new issue