-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.ubuntu
77 lines (55 loc) · 2.11 KB
/
Dockerfile.ubuntu
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM node:14.15.1-slim AS js-builder
WORKDIR /usr/src/app/
COPY package.json yarn.lock ./
COPY packages packages
RUN apt-get update && apt-get install -yq git
RUN yarn install --pure-lockfile
COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js ./
COPY public public
COPY tools tools
COPY scripts scripts
COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.23.2 AS go-builder
WORKDIR /src/plutono
COPY go.mod go.sum ./
RUN go mod verify
COPY build.go package.json ./
COPY pkg pkg/
RUN go run build.go build
FROM ubuntu:20.04
EXPOSE 3000
ARG PL_UID="472"
ARG PL_GID="472"
ENV PATH="/usr/share/plutono/bin:$PATH" \
PL_PATHS_CONFIG="/etc/plutono/plutono.ini" \
PL_PATHS_DATA="/var/lib/plutono" \
PL_PATHS_HOME="/usr/share/plutono" \
PL_PATHS_LOGS="/var/log/plutono" \
PL_PATHS_PLUGINS="/var/lib/plutono/plugins" \
PL_PATHS_PROVISIONING="/etc/plutono/provisioning"
WORKDIR $PL_PATHS_HOME
COPY conf conf
# curl should be part of the image
RUN apt-get update && apt-get install -y ca-certificates curl
RUN mkdir -p "$PL_PATHS_HOME/.aws" && \
addgroup --system --gid $PL_GID plutono && \
adduser --uid $PL_UID --system --ingroup plutono plutono && \
mkdir -p "$PL_PATHS_PROVISIONING/datasources" \
"$PL_PATHS_PROVISIONING/dashboards" \
"$PL_PATHS_PROVISIONING/notifiers" \
"$PL_PATHS_PROVISIONING/plugins" \
"$PL_PATHS_LOGS" \
"$PL_PATHS_PLUGINS" \
"$PL_PATHS_DATA" && \
cp conf/sample.ini "$PL_PATHS_CONFIG" && \
cp conf/ldap.toml /etc/plutono/ldap.toml && \
chown -R plutono:plutono "$PL_PATHS_DATA" "$PL_PATHS_HOME/.aws" "$PL_PATHS_LOGS" "$PL_PATHS_PLUGINS" "$PL_PATHS_PROVISIONING" && \
chmod -R 777 "$PL_PATHS_DATA" "$PL_PATHS_HOME/.aws" "$PL_PATHS_LOGS" "$PL_PATHS_PLUGINS" "$PL_PATHS_PROVISIONING"
COPY --from=go-builder /src/plutono/bin/linux-amd64/plutono-server /src/plutono/bin/linux-amd64/plutono-cli bin/
COPY --from=js-builder /usr/src/app/public public
COPY --from=js-builder /usr/src/app/tools tools
COPY packaging/docker/run.sh /
USER plutono
ENTRYPOINT [ "/run.sh" ]