-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.redis
41 lines (33 loc) · 1.32 KB
/
Dockerfile.redis
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
FROM ubuntu:18.04
# install apt dependencies
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y gfortran python3.8 curl python3.8-distutils libpq-dev python3.8-dev tzdata
RUN ln -s /usr/bin/python3.8 /usr/bin/python
# install poetry and project dependencies
RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python3.8
COPY poetry.lock pyproject.toml /app/
WORKDIR /app
ENV PYTHONIOENCODING=utf-8
RUN /root/.poetry/bin/poetry env use python3.8
RUN /root/.poetry/bin/poetry install --no-dev --no-interaction
# install rust
RUN apt-get update && \
apt-get install -y build-essential curl cmake && \
curl -sSf https://sh.rustup.rs | bash -s -- -y --profile minimal
ENV PATH="$HOME/.cargo/bin:$PATH"
# add redis
RUN cd /opt/ && \
curl -o redis.tar.gz https://download.redis.io/releases/redis-6.2.1.tar.gz && \
tar -xzf redis.tar.gz && \
rm redis.tar.gz && \
mv redis-6.2.1 redis && \
cd redis && \
make
# copy work files
COPY . /app
# compile native module
RUN export PATH="$HOME/.cargo/bin:$PATH" && \
cd /app/mutation_prediction_native && \
/root/.poetry/bin/poetry run maturin develop --release
ENTRYPOINT ["/root/.poetry/bin/poetry", "run", "bash", "/app/redis-entrypoint.sh"]