forked from openflagr/flagr-archived
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (36 loc) · 1.24 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
######################################
# Prepare npm_builder
######################################
FROM node:14 as npm_builder
WORKDIR /go/src/github.com/openflagr/flagr
ADD . .
ARG FLAGR_UI_POSSIBLE_ENTITY_TYPES=null
ENV VUE_APP_FLAGR_UI_POSSIBLE_ENTITY_TYPES ${FLAGR_UI_POSSIBLE_ENTITY_TYPES}
RUN make build_ui
######################################
# Prepare go_builder
######################################
FROM golang:1.17 as go_builder
WORKDIR /go/src/github.com/openflagr/flagr
ADD . .
RUN make build
######################################
# Copy from builder to alpine image
######################################
FROM frolvlad/alpine-glibc:alpine-3.14
RUN apk add --no-cache curl
WORKDIR /go/src/github.com/openflagr/flagr
VOLUME ["/data"]
ENV HOST=0.0.0.0
ENV PORT=18000
ENV FLAGR_DB_DBDRIVER=sqlite3
ENV FLAGR_DB_DBCONNECTIONSTR=/data/demo_sqlite3.db
ENV FLAGR_RECORDER_ENABLED=false
COPY --from=go_builder /go/src/github.com/openflagr/flagr/flagr ./flagr
COPY --from=npm_builder /go/src/github.com/openflagr/flagr/browser/flagr-ui/dist ./browser/flagr-ui/dist
ADD ./buildscripts ./buildscripts
ADD ./buildscripts/demo_sqlite3.db /data/demo_sqlite3.db
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser
EXPOSE 18000
CMD ./flagr