-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (36 loc) · 1.61 KB
/
Copy pathDockerfile
File metadata and controls
53 lines (36 loc) · 1.61 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM --platform=$BUILDPLATFORM node:22.12.0-bookworm-slim AS website-builder
WORKDIR /workspace
RUN npm install -g pnpm@10.32.1
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./
COPY apps/website ./apps/website
COPY packages ./packages
RUN pnpm install --filter @opentickly/website... --no-frozen-lockfile --ignore-scripts
RUN pnpm --filter @opentickly/website run build
FROM --platform=$BUILDPLATFORM golang:1.25.10-alpine AS builder
ARG OPENTOGGL_VERSION=dev
ARG TARGETOS
ARG TARGETARCH
WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY apps ./apps
COPY --from=website-builder /workspace/apps/website/dist ./apps/backend/internal/web/dist
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -trimpath -ldflags="-s -w -X main.version=${OPENTOGGL_VERSION}" \
-o /out/opentoggl ./apps/backend
FROM alpine:3.22
WORKDIR /app
COPY --from=builder /out/opentoggl /usr/local/bin/opentoggl
COPY apps/backend/opentoggl-entrypoint.sh /usr/local/bin/opentoggl-entrypoint
RUN apk add --no-cache ca-certificates wget tzdata
RUN printf '# required by current bootstrap env loader for runtime startup\n' > /app/.env.local
RUN chmod +x /usr/local/bin/opentoggl-entrypoint
ARG OPENTOGGL_VERSION=dev
LABEL org.opencontainers.image.title="OpenTickly" \
org.opencontainers.image.description="Single-image OpenTickly runtime (web + API)" \
org.opencontainers.image.source="https://github.com/CorrectRoadH/OpenTickly" \
org.opencontainers.image.version="${OPENTOGGL_VERSION}"
RUN adduser -D -u 10001 opentoggl
USER opentoggl
EXPOSE 8080
ENTRYPOINT ["opentoggl-entrypoint"]