-
Notifications
You must be signed in to change notification settings - Fork 218
/
Dockerfile
53 lines (36 loc) · 1.05 KB
/
Dockerfile
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
FROM golang:1.23-alpine3.19 AS build
WORKDIR /home/flipt
RUN apk add --update --no-cache npm git bash gcc build-base binutils-gold
RUN git clone https://github.com/magefile/mage && \
cd mage && \
go run bootstrap.go
COPY go.mod .
COPY go.sum .
COPY ./errors ./errors
COPY ./rpc/flipt ./rpc/flipt
COPY ./sdk ./sdk
COPY ./core ./core
RUN go mod download
COPY . /home/flipt
ENV CGO_ENABLED=1
RUN mage bootstrap && \
mage build
FROM alpine:3.19
LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.name="flipt"
LABEL org.opencontainers.image.source="https://github.com/flipt-io/flipt"
RUN apk add --update --no-cache postgresql-client \
openssl \
ca-certificates
RUN mkdir -p /etc/flipt && \
mkdir -p /var/opt/flipt && \
mkdir -p /var/log/flipt
COPY --from=build /home/flipt/bin/flipt /
COPY config/*.yml /etc/flipt/config/
RUN addgroup flipt && \
adduser -S -D -g '' -G flipt -s /bin/sh flipt && \
chown -R flipt:flipt /etc/flipt /var/opt/flipt /var/log/flipt
EXPOSE 8080
EXPOSE 9000
USER flipt
CMD ["./flipt"]