mirror of
https://github.com/aramperes/ts-activity.git
synced 2025-09-08 22:08:31 -04:00
Initial commit
This commit is contained in:
parent
343471e6a7
commit
f64a55b206
5 changed files with 234 additions and 0 deletions
29
Dockerfile
Normal file
29
Dockerfile
Normal file
|
@ -0,0 +1,29 @@
|
|||
FROM golang:latest as builder
|
||||
|
||||
# Set destination for COPY
|
||||
WORKDIR /app
|
||||
|
||||
# Download Go modules
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy the source code.
|
||||
COPY *.go ./
|
||||
|
||||
# Build
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/ts-activity
|
||||
|
||||
# Runner image
|
||||
FROM alpine:latest
|
||||
|
||||
RUN adduser --disabled-password tsactivity
|
||||
RUN apk --no-cache add dumb-init
|
||||
WORKDIR /home/tsactivity
|
||||
|
||||
COPY --from=builder /app/ts-activity /home/tsactivity/ts-activity
|
||||
RUN chmod +x /home/tsactivity/ts-activity
|
||||
|
||||
# Run
|
||||
USER tsactivity
|
||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||
CMD ["/home/tsactivity/ts-activity"]
|
Loading…
Add table
Add a link
Reference in a new issue