From fccdbdd66a612f96d558ac167854af8d88dc0097 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 29 Mar 2022 08:56:59 -0500 Subject: [PATCH] Update production dockerfile for a cleaner look (#86) --- ...erver.yml => build_push_server_latest.yml} | 6 +-- .../workflows/build_push_server_release.yml | 40 +++++++++++++++++++ Makefile | 5 ++- docker/docker-compose.yml | 27 +------------ mobile/pubspec.yaml | 2 +- 5 files changed, 48 insertions(+), 32 deletions(-) rename .github/workflows/{build_push_server.yml => build_push_server_latest.yml} (86%) create mode 100644 .github/workflows/build_push_server_release.yml diff --git a/.github/workflows/build_push_server.yml b/.github/workflows/build_push_server_latest.yml similarity index 86% rename from .github/workflows/build_push_server.yml rename to .github/workflows/build_push_server_latest.yml index 0d248ed5e..aabf7d556 100644 --- a/.github/workflows/build_push_server.yml +++ b/.github/workflows/build_push_server_latest.yml @@ -1,10 +1,6 @@ -name: Build Server +name: Build Server - Latest on: - # Triggers the workflow on push or pull request events but only for the main branch - #schedule: - # * is a special character in YAML so you have to quote this string - #- cron: '0 0 * * *' workflow_dispatch: push: branches: [main] diff --git a/.github/workflows/build_push_server_release.yml b/.github/workflows/build_push_server_release.yml new file mode 100644 index 000000000..d77dbbe05 --- /dev/null +++ b/.github/workflows/build_push_server_release.yml @@ -0,0 +1,40 @@ +name: Build Server - Release + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + buildandpush: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: "main" # branch + # https://github.com/docker/setup-qemu-action#usage + - name: Set up QEMU + uses: docker/setup-qemu-action@v1.2.0 + # https://github.com/marketplace/actions/docker-setup-buildx + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1.6.0 + # https://github.com/docker/login-action#docker-hub + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + # https://github.com/docker/build-push-action#multi-platform-image + - name: Build and push Immich + uses: docker/build-push-action@v2.10.0 + with: + context: ./server + file: ./server/Dockerfile + #platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 + platforms: linux/arm/v7,linux/amd64,linux/arm64 + pull: true + push: true + tags: | + altran1502/immich-server:${{github.ref_name}} diff --git a/Makefile b/Makefile index aad773297..767b9e2fe 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,10 @@ dev: docker-compose -f ./docker/docker-compose.dev.yml up --remove-orphans dev-update: - docker-compose -f ./docker/docker-compose.dev.yml up --build -V --remove-orphans + docker-compose -f ./docker/docker-compose.dev.yml up --build -V --remove-orphans dev-scale: docker-compose -f ./docker/docker-compose.dev.yml up --build -V --scale immich_server=3 --remove-orphans + +prod: + docker-compose -f ./docker/docker-compose.yml up --build -V --remove-orphans \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index ce43d4c8b..4df5d4c75 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -7,12 +7,11 @@ services: context: ../server dockerfile: ../server/Dockerfile entrypoint: ["/bin/sh", "./entrypoint.sh"] + restart: unless-stopped expose: - "3000" volumes: - - ../server:/usr/src/app - ${UPLOAD_LOCATION}:/usr/src/app/upload - - /usr/src/app/node_modules env_file: - .env environment: @@ -29,12 +28,11 @@ services: context: ../microservices dockerfile: ../microservices/Dockerfile entrypoint: ["/bin/sh", "./entrypoint.sh"] + restart: unless-stopped expose: - "3001" volumes: - - ../microservices:/usr/src/app - ${UPLOAD_LOCATION}:/usr/src/app/upload - - /usr/src/app/node_modules env_file: - .env environment: @@ -83,27 +81,6 @@ services: depends_on: - immich_server - # immich_tf_fastapi: - # container_name: immich_tf_fastapi - # image: tensor_flow_fastapi:1.0.0 - # restart: always - # command: uvicorn app.main:app --proxy-headers --host 0.0.0.0 --port 8000 --reload - # build: - # context: ../machine_learning - # target: cpu - # dockerfile: ../machine_learning/Dockerfile - # volumes: - # - ../machine_learning/app:/code/app - # - ${UPLOAD_LOCATION}:/code/app/upload - # ports: - # - 2285:8000 - # expose: - # - "8000" - # depends_on: - # - database - # networks: - # - immich_network - networks: immich_network: volumes: diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index 7e10f8b27..6ba29316f 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -2,7 +2,7 @@ name: immich_mobile description: A new Flutter project. publish_to: "none" -version: 1.4.0+0 +version: 1.4.0+6 environment: sdk: ">=2.15.1 <3.0.0"