diff --git a/.drone.yml b/.drone.yml index c144b5a..9b994cc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,7 +5,7 @@ name: build-arm platform: os: linux - arch: arm + arch: arm64 workspace: base: /go @@ -23,8 +23,6 @@ steps: - ln idfm-api-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} deploy/idfm-api environment: CGO_ENABLED: 0 - GOARCH: arm - GOARM: 5 when: event: exclude: @@ -41,29 +39,20 @@ steps: - ln idfm-api-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} deploy/idfm-api environment: CGO_ENABLED: 0 - GOARCH: arm - GOARM: 5 when: event: - tag -- name: deploy - image: appleboy/drone-scp:linux-arm +- name: docker + image: plugins/docker settings: - tar_tmp_path: /tmp/ - host: ratp.p0m.fr - target: /usr/local/bin/ratp - source: deploy/idfm-api - strip_components: 1 + registry: registry.nemunai.re + repo: registry.nemunai.re/idfm-api + auto_tag: true username: - from_secret: ssh_username - key: - from_secret: deploy_key - port: - from_secret: ssh_port - when: - branch: - - master + from_secret: docker_username + password: + from_secret: docker_password trigger: event: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d3122f7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1-alpine AS build + +COPY . /go/src/git.nemunai.re/idfm-api +WORKDIR /go/src/git.nemunai.re/idfm-api +RUN go get -v && go generate -v && go build -v -ldflags="-s -w" + + +FROM alpine:3.18 + +EXPOSE 8080 +CMD ["/srv/idfm-api"] + +COPY --from=build /go/src/git.nemunai.re/idfm-api/idfm-api /srv/idfm-api