hub/Dockerfile

47 lines
1 KiB
Text
Raw Normal View History

2022-03-18 18:01:47 +01:00
FROM debian:11-slim
STOPSIGNAL SIGINT
2022-03-18 18:01:47 +01:00
ARG user=lbry
ARG db_dir=/database
ARG projects_dir=/home/$user
ARG DOCKER_TAG
ARG DOCKER_COMMIT=docker
ENV DOCKER_TAG=$DOCKER_TAG DOCKER_COMMIT=$DOCKER_COMMIT
RUN apt-get update && \
apt-get -y --no-install-recommends install \
wget \
tar unzip \
2022-03-31 17:26:43 +02:00
build-essential libssl-dev libffi-dev \
2022-03-18 18:01:47 +01:00
automake libtool \
pkg-config \
python3.9 \
python3.9-dev \
2022-03-31 17:23:43 +02:00
python3-cffi \
2022-03-18 18:01:47 +01:00
python3-pip && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \
rm -rf /var/lib/apt/lists/*
RUN groupadd -g 999 $user && useradd -m -u 999 -g $user $user
RUN mkdir -p $db_dir
RUN chown -R $user:$user $db_dir
2022-05-18 19:09:42 +02:00
COPY docker $projects_dir
2022-03-18 18:01:47 +01:00
RUN chown -R $user:$user $projects_dir
USER $user
WORKDIR $projects_dir
RUN python3.9 -m pip install pip
RUN python3.9 -m pip install -e .
2022-05-18 19:09:42 +02:00
RUN python3.9 scripts/set_build.py
2022-03-18 18:01:47 +01:00
RUN rm ~/.cache -rf
# entry point
VOLUME $db_dir
ENV DB_DIRECTORY=$db_dir
2022-05-18 19:09:42 +02:00
COPY ./scripts/entrypoint.sh /entrypoint.sh
2022-03-18 18:01:47 +01:00
ENTRYPOINT ["/entrypoint.sh"]