-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDockerfile-local
More file actions
45 lines (43 loc) · 1.15 KB
/
Dockerfile-local
File metadata and controls
45 lines (43 loc) · 1.15 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
# syntax=docker/dockerfile:1
FROM node:20-slim AS ui-builder
WORKDIR /src
COPY web-ui/package.json web-ui/package-lock.json ./web-ui/
RUN cd web-ui && npm ci
COPY web-ui/ ./web-ui/
COPY pkg/web/static/embed.go ./pkg/web/static/
RUN cd web-ui && npm run build
FROM golang:1.25 AS builder
WORKDIR /src
COPY go.sum go.mod ./
RUN go mod download
COPY main.go Makefile ./
ADD .git ./.git
ADD cmd ./cmd
ADD pkg ./pkg
COPY --from=ui-builder /src/pkg/web/static/ ./pkg/web/static/
RUN make build
FROM debian:stable-slim
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
libssl-dev \
ca-certificates \
jq \
git \
curl \
make \
sudo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& update-ca-certificates
ARG userid=10001
ARG groupid=10001
RUN (getent group ${groupid} || groupadd -g ${groupid} assertoor) && \
useradd -m -u ${userid} -g ${groupid} assertoor
RUN echo "assertoor ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/assertoor
WORKDIR /app
COPY --from=builder /src/bin/* /app/
RUN chown -R assertoor:${groupid} /app
RUN mkdir /workspace
USER assertoor
WORKDIR /workspace
EXPOSE 8080
ENTRYPOINT ["/app/assertoor"]