-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (29 loc) · 909 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (29 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# syntax=docker/dockerfile:1.7-labs
FROM golang:1.26.1-alpine AS base
WORKDIR /app
COPY --exclude=./web --exclude=.git go.mod go.sum ./
RUN go mod download
FROM base AS development
RUN go install github.com/air-verse/air@latest
COPY . .
ENTRYPOINT ["air"]
FROM base AS builder
COPY --exclude=./web --exclude=.git . .
RUN go build -o /app/server ./cmd/...
FROM alpine:3.21 AS deployment
WORKDIR /app
COPY --from=builder /app/server .
RUN apk add --no-cache nodejs npm && \
npm install -g @infisical/cli
ENTRYPOINT ["/bin/sh", "-c", "\
INFISICAL_TOKEN=$(infisical login \
--method=universal-auth \
--client-id=\"$INFISICAL_CLIENT_ID\" \
--client-secret=\"$INFISICAL_CLIENT_SECRET\" \
--silent --plain) && \
export INFISICAL_TOKEN && \
exec infisical run \
--projectId=\"$INFISICAL_PROJECT_ID\" \
--env=\"$INFISICAL_ENV\" \
--path=\"$INFISICAL_PATH\" \
-- ./server"]