initial commit
All checks were successful
Build and publish the docker image / build (push) Successful in 58s
All checks were successful
Build and publish the docker image / build (push) Successful in 58s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@ -0,0 +1,36 @@
|
||||
FROM golang:1.24.0 AS builder
|
||||
|
||||
RUN apt update
|
||||
RUN apt install -y sassc
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY *.mod ./
|
||||
COPY *.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY *.go ./
|
||||
COPY Makefile ./
|
||||
COPY static ./static
|
||||
COPY extract ./extract
|
||||
COPY routes ./routes
|
||||
COPY util ./util
|
||||
COPY views ./views
|
||||
|
||||
RUN make CGO_ENABLED=0
|
||||
|
||||
FROM alpine AS runner
|
||||
|
||||
RUN adduser -h /app -D -u 1001 runner
|
||||
|
||||
COPY --from=builder /src/tren.elf /app/tren.elf
|
||||
COPY --from=builder /src/views /app/views
|
||||
COPY --from=builder /src/static /app/static
|
||||
|
||||
RUN rm /app/static/css/*.scss
|
||||
RUN chown -R runner:runner /app
|
||||
USER runner
|
||||
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["/app/tren.elf"]
|
Reference in New Issue
Block a user