-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (41 loc) · 1.3 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (41 loc) · 1.3 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
54
55
##############
## FRONTEND ##
##############
FROM node:24-slim AS build-frontend-web
RUN corepack prepare pnpm@10 --activate
RUN corepack enable
WORKDIR /app/frontend/web
# deps
COPY pnpm-lock.yaml pnpm-workspace.yaml /app
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch --frozen-lockfile
COPY frontend/web/package.json .
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile
# gen pwa assets
COPY frontend/web/pwa-assets.config.ts .
COPY frontend/web/src/consts.ts src/consts.ts
COPY frontend/web/public/logo.svg public/logo.svg
RUN pnpm gen:pwa-assets
COPY frontend/web .
ARG VERSION=UNKNOWN
ENV VERSION=$VERSION
RUN pnpm build
# copy apple-touch-icon.png becuase reading the correct filename seems to be hard
RUN cp dist/apple-touch-icon-180x180.png dist/apple-touch-icon.png
#############
## BACKEND ##
#############
FROM golang:1.26-alpine AS build-backend
WORKDIR /app
COPY backend/go.mod backend/go.sum ./
RUN go mod download && go mod verify
COPY backend .
RUN go build -v -o ./adnexos cmd/adnexos/main.go
#########
## RUN ##
#########
FROM alpine
WORKDIR /app
COPY --from=build-frontend-web /app/frontend/web/dist pb_public/
COPY --from=build-backend /app/adnexos adnexos
EXPOSE 8090
CMD ["./adnexos", "serve", "--http=0.0.0.0:8090"]