-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (29 loc) · 998 Bytes
/
Dockerfile
File metadata and controls
46 lines (29 loc) · 998 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
FROM golang:1.26-trixie AS builder
ARG COMMIT
ARG DATE
ARG VERSION
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 go build -o ha -ldflags="-X main.commit=$COMMIT -X main.date=$DATE -X main.version=$VERSION" .
# Production image
FROM debian:trixie-slim AS production
LABEL org.opencontainers.image.authors="Walter Alves Wanderley <walterwanderley@gmail.com>"
LABEL org.opencontainers.image.source=https://github.com/litesql/ha
RUN groupadd --system --gid 1000 ha && \
useradd --system --uid 1000 --gid 1000 --home /data ha
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN mkdir -p /data && chown -R ha:ha /data
VOLUME /data
COPY --from=builder /build/ha .
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
EXPOSE 3306 4222 5432 6222 8080
USER ha
ENV HA_NATS_STORE_DIR="/data"
ENV HA_PG_PORT=5432
ENV HA_MYSQL_PORT=3306
ENV HA_ARGS=
ENTRYPOINT ["/app/entrypoint.sh"]