-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (35 loc) · 1.29 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
###############################################
FROM ubuntu:22.04 as builder
RUN apt update
RUN apt install -y \
build-essential \
clang lld curl \
libssl-dev pkg-config
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
ENV CARGO_INCREMENTAL="0"
# Disable full debug symbol generation to speed up CI build
# "1" means line tables only, which is useful for panic tracebacks.
ENV CARGO_PROFILE_DEV_DEBUG="1"
# https://github.com/rust-lang/cargo/issues/10280
ENV CARGO_NET_GIT_FETCH_WITH_CLI="true"
# Building job will be killed in docker for using to much ram.
# By using only one job, we limit the ram usage.
# ENV CARGO_BUILD_JOBS="1"
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
COPY . /ol-data
WORKDIR /ol-data
RUN cargo build \
--profile="release"
RUN strip ./target/release/ol-data
###############################################
FROM ubuntu:22.04 as ol-data
COPY --from=builder /ol-data/target/release/ol-data /bin/ol-data
env PORT="4000"
env CLICKHOUSE_HOST="http://127.0.0.1:8123"
env CLICKHOUSE_USERNAME="default"
env CLICKHOUSE_PASSWORD="default"
env CLICKHOUSE_DATABASE="olfyi"
CMD ["ol-data"]