Add Dockerfile
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
nemunaire 2023-11-14 11:29:48 +01:00
parent 8e948fc451
commit e89099a18c
2 changed files with 32 additions and 0 deletions

26
Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM node:20-alpine as nodebuild
WORKDIR /ui
COPY ui/ .
RUN npm install --network-timeout=100000 && \
npm run build
FROM golang:1-alpine AS build
RUN apk --no-cache add git go-bindata
COPY . /go/src/git.nemunai.re/nemunaire/hathoris
COPY --from=nodebuild /ui/build /go/src/git.nemunai.re/nemunaire/hathoris/ui/build
WORKDIR /go/src/git.nemunai.re/nemunaire/hathoris
RUN go get && go generate && go build -ldflags="-s -w"
FROM alpine:3.18
EXPOSE 8080
CMD ["/srv/hathoris"]
COPY --from=build /go/src/git.nemunai.re/nemunaire/hathoris/hathoris /srv/hathoris

6
Dockerfile-norebuild Normal file
View File

@ -0,0 +1,6 @@
FROM alpine:3.18
EXPOSE 8080
CMD ["/srv/hathoris"]
COPY hathoris /srv/hathoris