Skip to content

Commit

Permalink
Merge pull request #6773 from xoriole/feature/docker
Browse files Browse the repository at this point in the history
Docker support
  • Loading branch information
xoriole authored Feb 17, 2022
2 parents 14a0c9a + c5a9e83 commit 2e9e6ca
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Image CI

on:
push:
branches: [ main ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: docker login
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Build the Docker image
run: docker build . --file Dockerfile --tag triblercore/triblercore:latest
- name: Push to Docker Hub
run: docker push ${{secrets.DOCKER_USER}}/triblercore:latest
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ FROM triblercore/libtorrent:1.2.10-x
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

# 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 ./src/pyipv8/requirements.txt /requirements/pyipv8-requirements.txt
RUN pip3 install -r /requirements/pyipv8-requirements.txt
RUN mkdir requirements
COPY ./src/pyipv8/requirements.txt requirements/pyipv8-requirements.txt
RUN pip3 install -r requirements/pyipv8-requirements.txt

COPY ./src/tribler-core/tribler_core/requirements.txt /requirements/core-requirements.txt
RUN pip3 install -r /requirements/core-requirements.txt
COPY ./src/tribler-core/tribler_core/requirements.txt requirements/core-requirements.txt
RUN pip3 install -r requirements/core-requirements.txt

# Copy the source code and set the working directory
COPY ./ /tribler
WORKDIR /tribler
COPY ./ tribler
WORKDIR tribler

# Set the REST API port and expose it
ENV CORE_API_PORT=52194
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
container_name: triblercore
network_mode: "host"
build: .
volumes:
- ~/.Tribler:/home/user/.Tribler
environment:
CORE_API_PORT: 52194

0 comments on commit 2e9e6ca

Please sign in to comment.