diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 00000000..d37058bd --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,36 @@ +name: Container + +on: + push: + pull_request: + +jobs: + docker: + name: Docker + runs-on: ubuntu-latest + steps: + - id: checkout + name: Checkout Repository + uses: actions/checkout@v3 + + - id: setup + name: Setup Toolchain + uses: docker/setup-buildx-action@v2 + + - id: build + name: Build + uses: docker/build-push-action@v4 + with: + context: . + load: true + push: false + tags: index-backend:local + cache-from: type=gha + cache-to: type=gha,mode=max + + - id: inspect + name: Inspect + run: docker image inspect index-backend:local + + - name: Build docker-compose images + run: docker compose build diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml deleted file mode 100644 index efb54e60..00000000 --- a/.github/workflows/test_docker.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Test Docker Build - -on: - push: - pull_request: - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build docker image - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - push: false - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Build docker-compose images - run: docker compose build diff --git a/compose.yaml b/compose.yaml index 2c46d9df..283d114c 100644 --- a/compose.yaml +++ b/compose.yaml @@ -2,16 +2,12 @@ name: torrust services: idx-back: - build: - context: . - args: - RUN_AS_USER: appuser - UID: ${TORRUST_IDX_BACK_USER_UID:-1000} - target: development + image: index-backend:local user: ${TORRUST_IDX_BACK_USER_UID:-1000}:${TORRUST_IDX_BACK_USER_UID:-1000} tty: true environment: - TORRUST_IDX_BACK_CONFIG=${TORRUST_IDX_BACK_CONFIG} + - TORRUST_IDX_BACK_CORS_PERMISSIVE=true - CARGO_HOME=/home/appuser/.cargo networks: - server_side @@ -29,8 +25,7 @@ services: # start_period: 10s # timeout: 3s volumes: - - ./:/app - - ~/.cargo:/home/appuser/.cargo + - ./storage:/app/storage depends_on: - tracker - mailcatcher diff --git a/project-words.txt b/project-words.txt index a890960f..01a90aef 100644 --- a/project-words.txt +++ b/project-words.txt @@ -7,6 +7,8 @@ bencoded Benoit binascii btih +buildcache +buildx chrono clippy codecov