aboutsummaryrefslogtreecommitdiffstats
path: root/.github/docker/Dockerfile
blob: d266c29a933ab6cb6a3bbeb8ee8e34782d214c26 (plain) (blame)
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
# syntax=docker/dockerfile:1
FROM ubuntu:22.04 AS builder

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
      python3 curl lsb-release python3-dev libc6-dev libidn11-dev libaio1 libaio-dev libgcc-11-dev binutils tree git

COPY ydb/ /ydbwork/ydb/

WORKDIR /ydbwork/ydb/

RUN ./ya make -r -T \
      -C ydb/apps/ydbd/ydbd \
      -C ydb/apps/ydb/ydb \
      -C ydb/public/tools/local_ydb/local_ydb \
      -o /ydbwork/out/ \
    && /ydbwork/out/ydb/apps/ydbd/ydbd -V \
    && tree /ydbwork/out/ \
    && strip /ydbwork/out/ydb/apps/ydbd/ydbd /ydbwork/out/ydb/apps/ydb/ydb /ydbwork/out/ydb/public/tools/local_ydb/local_ydb \
    && rm -rf ~/.ya  || echo 'unable to delete ~/.ya' # for reduce cache size


FROM ubuntu:22.04
RUN apt-get update  \
    && apt-get install --no-install-recommends -y libidn12 libaio1 \
    && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /root/ydb/bin/ \
    && mkdir -p /ydb_data \
    && mkdir -p ydb_certs \
    && echo '{"check_version":false}' > root/ydb/bin/config.json

COPY main/.github/docker/files/ /
COPY --from=builder \
    /ydbwork/out/ydb/apps/ydbd/ydbd \
    /ydbwork/out/ydb/apps/ydb/ydb \
    /ydbwork/out/ydb/public/tools/local_ydb/local_ydb \
    /

# YDB grpc
EXPOSE ${GRPC_TLS_PORT:-2135}
EXPOSE ${GRPC_PORT:-2136}
EXPOSE ${MON_PORT:-8765}

HEALTHCHECK --start-period=60s --interval=1s CMD sh ./health_check

CMD ["sh", "./initialize_local_ydb"]