mirror of
https://github.com/wahyd4/topx.git
synced 2026-08-08 21:01:17 +10:00
Add Dockerfile
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
FROM golang:alpine AS build
|
||||
|
||||
RUN apk add --no-cache git openssh
|
||||
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=amd64
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go mod download
|
||||
RUN go build -o bin/app main.go
|
||||
|
||||
FROM alpine:edge
|
||||
|
||||
RUN adduser -D -u 1000 junv
|
||||
|
||||
WORKDIR /home/junv
|
||||
|
||||
USER junv
|
||||
|
||||
COPY --from=build /app/bin/app .
|
||||
COPY --from=build /app/test*.txt ./
|
||||
|
||||
CMD [ "/home/junv/app" ]
|
||||
Reference in New Issue
Block a user