You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
1.2 KiB
22 lines
1.2 KiB
|
2 months ago
|
FROM golang:1.25-bookworm AS build
|
||
|
|
|
||
|
|
WORKDIR /src/services/tera-api
|
||
|
|
COPY services/tera-api/ ./
|
||
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -trimpath -o /out/tera-api ./cmd/tera-api \
|
||
|
|
&& CGO_ENABLED=0 GOOS=linux go build -mod=vendor -trimpath -o /out/tera-seriald ./cmd/tera-seriald \
|
||
|
|
&& CGO_ENABLED=0 GOOS=linux go build -mod=vendor -trimpath -o /out/tera-sessiond ./cmd/tera-sessiond \
|
||
|
|
&& CGO_ENABLED=0 GOOS=linux go build -mod=vendor -trimpath -o /out/tera-web ./cmd/tera-web
|
||
|
|
|
||
|
|
FROM alpine:3.22
|
||
|
|
|
||
|
|
RUN addgroup -S tera && adduser -S -D -H -s /sbin/nologin -G tera tera \
|
||
|
|
&& mkdir -p /etc/tera /usr/share/tera-web /var/lib/tera-api /run/tera-api /run/tera-seriald \
|
||
|
|
&& chown -R tera:tera /var/lib/tera-api /run/tera-api /run/tera-seriald
|
||
|
|
COPY --from=build /out/tera-api /out/tera-seriald /out/tera-sessiond /out/tera-web /usr/bin/
|
||
|
|
COPY services/tera-api/deploy/etc/tera/serial-map.json /etc/tera/serial-map.json
|
||
|
|
COPY webapp/ /usr/share/tera-web/
|
||
|
|
COPY services/tera-api/deploy/docker/entrypoint.sh /usr/local/bin/tera-entrypoint
|
||
|
|
RUN chmod 0755 /usr/local/bin/tera-entrypoint /usr/bin/tera-api /usr/bin/tera-seriald /usr/bin/tera-sessiond /usr/bin/tera-web
|
||
|
|
|
||
|
|
ENTRYPOINT ["/usr/local/bin/tera-entrypoint"]
|