Skip to content

Commit

Permalink
SSH test
Browse files Browse the repository at this point in the history
  • Loading branch information
Karakoc committed Nov 29, 2024
1 parent 6d897bf commit dc60bcc
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Dockerfile (copy)
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM node:20 as node

WORKDIR /app
COPY web web

## remove generated files in case the developer build with npm before
RUN rm -rf web/assets/ts-dist &&\
rm -rf web/assets/css-dist

WORKDIR /app/web
RUN npm i --no-dev

FROM golang:1.21-alpine3.18 as build-env

RUN mkdir /gostuff
WORKDIR /gostuff
COPY go.mod go.sum ./

# Get dependencies - will also be cached if we won't change mod/sum
RUN go mod download

WORKDIR /go/src/app
COPY . .
COPY --from=node /app/web/assets ./web/assets
COPY --from=node /app/web/node_modules ./web/node_modules

# bundle version into binary if specified in build-args, dev otherwise.
ARG version=dev
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-w -extldflags '-static' -X main.VersionTag=${version}" -o /go/bin/tumlive cmd/tumlive/tumlive.go

FROM alpine:3.18
RUN apk add --no-cache tzdata openssl
WORKDIR /app
COPY --from=build-env /go/bin/tumlive .
CMD ["sh", "-c", "sleep 3 && ./tumlive"]

0 comments on commit dc60bcc

Please sign in to comment.