forked from gabehf/Koito
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (33 loc) · 881 Bytes
/
Dockerfile
File metadata and controls
50 lines (33 loc) · 881 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM node AS frontend
ARG KOITO_VERSION
ENV VITE_KOITO_VERSION=$KOITO_VERSION
ENV BUILD_TARGET=docker
WORKDIR /client
COPY ./client/package.json ./client/yarn.lock ./
RUN yarn install
COPY ./client .
RUN yarn run build
FROM golang:1.24 AS backend
ARG KOITO_VERSION
ENV CGO_ENABLED=1
ENV GOOS=linux
WORKDIR /app
RUN apt-get update && \
apt-get install -y libvips-dev pkg-config && \
rm -rf /var/lib/apt/lists/*
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -ldflags "-X main.Version=$KOITO_VERSION" -o app ./cmd/api
FROM debian:bookworm-slim AS final
WORKDIR /app
RUN apt-get update && \
apt-get install -y libvips42 && \
rm -rf /var/lib/apt/lists/*
COPY --from=backend /app/app ./app
COPY --from=frontend /client/build ./client/build
COPY ./client/public ./client/public
COPY ./assets ./assets
COPY ./db ./db
EXPOSE 4110
ENTRYPOINT ["./app"]