forked from apache/horaedb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 1.03 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
ARG RUST_VERSION=1.59.0
FROM rust:${RUST_VERSION}-slim-bullseye as build
# cache mounts below may already exist and owned by root
USER root
RUN apt update && apt install --yes gcc g++ libssl-dev pkg-config cmake && rm -rf /var/lib/apt/lists/*
# Build ceresdb
COPY . /ceresdb
WORKDIR /ceresdb
RUN make build
FROM ubuntu:20.04
# create admin user
ARG USER=admin
ARG PASS="1q2w3s"
RUN useradd -m -s /bin/bash $USER && echo "$USER:$PASS" | chpasswd
COPY --from=build /ceresdb/target/release/ceresdb-server /usr/bin/ceresdb-server
RUN apt update && apt install --yes curl gdb iotop cron supervisor python vim less net-tools
ENV RUST_BACKTRACE 1
COPY ./docker/entrypoint.py /entrypoint.py
COPY ./docker/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY ./docker/supervisor/conf.d /etc/supervisor/conf.d/
COPY ./configs/ceresdb.toml /usr/bin/
RUN mkdir -p /etc/ceresdb
COPY ./configs/ceresdb.toml /etc/ceresdb/
RUN chmod +x /usr/bin/ceresdb-server
COPY ./docker/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--", "/entrypoint.py"]