-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
68 lines (53 loc) · 1.68 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu:20.04
# Prevents prompts and dialogues during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Setup the deadsnakes PPA and other basic dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
apt-transport-https \
curl \
gnupg \
git \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update
# Install other required packages
RUN apt-get install -y \
protobuf-compiler \
rapidjson-dev \
clang-format \
build-essential \
openjdk-11-jdk \
zip unzip \
python3.10 \
python3.10-dev \
python3-venv \
python3-dev \
python3-pip \
python3-distutils
# Set python3.10 as the default python3 version
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
python3 --version
# Install pip3 using the get-pip.py script
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3 get-pip.py && \
rm get-pip.py
# Cleanup apt cache
RUN rm -rf /var/lib/apt/lists/*
# Add Bazel repository and its GPG key
RUN curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64 \
&& chmod +x /usr/local/bin/bazel
# Set the working directory
WORKDIR /app
# Copy your project files to the container
COPY . /app
RUN pip3 install virtualenv && \
. venv/bin/activate && \
pip install --upgrade setuptools && \
pip install -r requirements.txt
RUN sh service/tools/start_kv_service_sdk.sh
# Expose port
EXPOSE 18000
# Set healthcheck
HEALTHCHECK CMD curl -f http://localhost:18000/ || exit 1
RUN bazel build service/http_server/crow_service_main
ENTRYPOINT ["./entrypoint.sh"]