-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use python base image & add more input args to allow changing mount d…
- Loading branch information
Showing
5 changed files
with
58 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
# The base image already builds the libtorrent dependency so only Python pip packages | ||
# are necessary to be installed to run Tribler core process. | ||
FROM triblercore/libtorrent:1.2.10-x | ||
# libtorrent-1.2.9 does not support python 3.11 yet | ||
FROM python:3.10-slim | ||
|
||
# Update the base system and install required libsodium and Python pip | ||
RUN apt update && apt upgrade -y | ||
RUN apt install -y libsodium23 python3-pip git | ||
|
||
RUN useradd -ms /bin/bash user | ||
USER user | ||
WORKDIR /home/user | ||
RUN apt-get update \ | ||
Check notice on line 4 in Dockerfile Codacy Production / Codacy Static Code AnalysisDockerfile#L4
|
||
&& apt-get install -y libsodium23 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Then, install pip dependencies so that it can be cached and does not | ||
# need to be built every time the source code changes. | ||
# This reduces the docker build time. | ||
RUN mkdir requirements | ||
COPY ./requirements-core.txt requirements/core-requirements.txt | ||
RUN pip3 install -r requirements/core-requirements.txt | ||
COPY ./requirements-core.txt /app/tribler/core-requirements.txt | ||
RUN pip3 install -r /app/tribler/core-requirements.txt | ||
|
||
# Copy the source code and set the working directory | ||
COPY ./ tribler | ||
WORKDIR /home/user/tribler | ||
COPY ./src /app/tribler/src/ | ||
WORKDIR /app/tribler/ | ||
|
||
# Set the REST API port and expose it | ||
# Set to -1 to use the default | ||
ENV CORE_API_PORT=20100 | ||
EXPOSE 20100 | ||
ENV IPV8_PORT=7759 | ||
ENV TORRENT_PORT=-1 | ||
ENV DOWNLOAD_DIR=/downloads | ||
ENV TSTATEDIR=/state | ||
|
||
VOLUME /state | ||
VOLUME /downloads | ||
|
||
# Only run the core process with --core switch | ||
CMD ["./src/tribler.sh", "--core"] | ||
CMD exec python3 /app/tribler/src/run_tribler_headless.py --restapi_http_port=${CORE_API_PORT} --ipv8=${IPV8_PORT} --libtorrent=${TORRENT_PORT} --restapi_http_host=0.0.0.0 --restapi_https_host=0.0.0.0 "--statedir=${TSTATEDIR}" "--downloaddir=${DOWNLOAD_DIR}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters