mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	Build and tag docker image for Dockerhub release (#111)
* Clean up Dockerfile and added action to build microservice latest * Combine build microservices and server into the same action * Added build and push release version for microservices
This commit is contained in:
		
							
								
								
									
										64
									
								
								.github/workflows/build_push_docker_latest.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								.github/workflows/build_push_docker_latest.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,64 @@
 | 
				
			|||||||
 | 
					name: Build and Push Docker Image - Latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  workflow_dispatch:
 | 
				
			||||||
 | 
					  push:
 | 
				
			||||||
 | 
					    branches: [main]
 | 
				
			||||||
 | 
					  pull_request:
 | 
				
			||||||
 | 
					    branches: [main]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  build_and_push_server_latest:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - name: Checkout
 | 
				
			||||||
 | 
					        uses: actions/checkout@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          ref: "main" # branch
 | 
				
			||||||
 | 
					      - name: Set up QEMU
 | 
				
			||||||
 | 
					        uses: docker/setup-qemu-action@v1.2.0
 | 
				
			||||||
 | 
					      - name: Set up Docker Buildx
 | 
				
			||||||
 | 
					        id: buildx
 | 
				
			||||||
 | 
					        uses: docker/setup-buildx-action@v1.6.0
 | 
				
			||||||
 | 
					      - name: Login to Docker Hub
 | 
				
			||||||
 | 
					        uses: docker/login-action@v1
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          username: ${{ secrets.DOCKERHUB_USERNAME }}
 | 
				
			||||||
 | 
					          password: ${{ secrets.DOCKERHUB_TOKEN }}
 | 
				
			||||||
 | 
					      - name: Build and push Immich
 | 
				
			||||||
 | 
					        uses: docker/build-push-action@v2.10.0
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          context: ./server
 | 
				
			||||||
 | 
					          file: ./server/Dockerfile
 | 
				
			||||||
 | 
					          platforms: linux/arm/v7,linux/amd64,linux/arm64
 | 
				
			||||||
 | 
					          push: ${{ github.event_name != 'pull_request' }}
 | 
				
			||||||
 | 
					          tags: |
 | 
				
			||||||
 | 
					            altran1502/immich-server:latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  build_and_push_microservice_latest:
 | 
				
			||||||
 | 
					      runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					      steps:
 | 
				
			||||||
 | 
					        - name: Checkout
 | 
				
			||||||
 | 
					          uses: actions/checkout@v3
 | 
				
			||||||
 | 
					          with:
 | 
				
			||||||
 | 
					            ref: "main" # branch
 | 
				
			||||||
 | 
					        - name: Set up QEMU
 | 
				
			||||||
 | 
					          uses: docker/setup-qemu-action@v1.2.0
 | 
				
			||||||
 | 
					        - name: Set up Docker Buildx
 | 
				
			||||||
 | 
					          id: buildx
 | 
				
			||||||
 | 
					          uses: docker/setup-buildx-action@v1.6.0
 | 
				
			||||||
 | 
					        - name: Login to Docker Hub
 | 
				
			||||||
 | 
					          uses: docker/login-action@v1
 | 
				
			||||||
 | 
					          with:
 | 
				
			||||||
 | 
					            username: ${{ secrets.DOCKERHUB_USERNAME }}
 | 
				
			||||||
 | 
					            password: ${{ secrets.DOCKERHUB_TOKEN }}
 | 
				
			||||||
 | 
					        - name: Build and Push Microservices
 | 
				
			||||||
 | 
					          uses: docker/build-push-action@v2.10.0
 | 
				
			||||||
 | 
					          with:
 | 
				
			||||||
 | 
					            context: ./microservices
 | 
				
			||||||
 | 
					            file: ./microservices/Dockerfile
 | 
				
			||||||
 | 
					            platforms: linux/arm/v7,linux/amd64
 | 
				
			||||||
 | 
					            push: ${{ github.event_name != 'pull_request' }}
 | 
				
			||||||
 | 
					            tags: |
 | 
				
			||||||
 | 
					              altran1502/immich-microservices:latest
 | 
				
			||||||
							
								
								
									
										42
									
								
								.github/workflows/build_push_server_latest.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										42
									
								
								.github/workflows/build_push_server_latest.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,42 +0,0 @@
 | 
				
			|||||||
name: Build Server - Latest
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
on:
 | 
					 | 
				
			||||||
  workflow_dispatch:
 | 
					 | 
				
			||||||
  push:
 | 
					 | 
				
			||||||
    branches: [main]
 | 
					 | 
				
			||||||
  pull_request:
 | 
					 | 
				
			||||||
    branches: [main]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
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:latest
 | 
					 | 
				
			||||||
							
								
								
									
										81
									
								
								.github/workflows/build_push_server_release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										81
									
								
								.github/workflows/build_push_server_release.yml
									
									
									
									
										vendored
									
									
								
							@@ -2,37 +2,94 @@ name: Build Server - Release
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
on:
 | 
					on:
 | 
				
			||||||
  workflow_dispatch:
 | 
					  workflow_dispatch:
 | 
				
			||||||
 | 
					  release:
 | 
				
			||||||
 | 
					    types: [published]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  buildandpush:
 | 
					  build_and_push_server_release:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: Checkout
 | 
					      - name: Checkout
 | 
				
			||||||
        uses: actions/checkout@v3
 | 
					        uses: actions/checkout@v3
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          ref: "main" # branch
 | 
					          ref: "main" 
 | 
				
			||||||
      # https://github.com/docker/setup-qemu-action#usage
 | 
					          fetch-depth: 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Docker meta
 | 
				
			||||||
 | 
					        id: meta
 | 
				
			||||||
 | 
					        uses: docker/metadata-action@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          images: altran1502/immich-server
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					      - name: 'Get Previous tag'
 | 
				
			||||||
 | 
					        id: previoustag
 | 
				
			||||||
 | 
					        uses: "WyriHaximus/github-action-get-previous-tag@v1"
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					            fallback: latest 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Set up QEMU
 | 
					      - name: Set up QEMU
 | 
				
			||||||
        uses: docker/setup-qemu-action@v1.2.0
 | 
					        uses: docker/setup-qemu-action@v1.2.0
 | 
				
			||||||
      # https://github.com/marketplace/actions/docker-setup-buildx
 | 
					
 | 
				
			||||||
      - name: Set up Docker Buildx
 | 
					      - name: Set up Docker Buildx
 | 
				
			||||||
        id: buildx
 | 
					        id: buildx
 | 
				
			||||||
        uses: docker/setup-buildx-action@v1.6.0
 | 
					        uses: docker/setup-buildx-action@v1.6.0
 | 
				
			||||||
      # https://github.com/docker/login-action#docker-hub
 | 
					
 | 
				
			||||||
      - name: Login to Docker Hub
 | 
					      - name: Login to Docker Hub
 | 
				
			||||||
        uses: docker/login-action@v1
 | 
					        uses: docker/login-action@v1
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          username: ${{ secrets.DOCKERHUB_USERNAME }}
 | 
					          username: ${{ secrets.DOCKERHUB_USERNAME }}
 | 
				
			||||||
          password: ${{ secrets.DOCKERHUB_TOKEN }}
 | 
					          password: ${{ secrets.DOCKERHUB_TOKEN }}
 | 
				
			||||||
      # https://github.com/docker/build-push-action#multi-platform-image
 | 
					
 | 
				
			||||||
      - name: Build and push Immich
 | 
					      - name: Build and push immich-server release
 | 
				
			||||||
        uses: docker/build-push-action@v2.10.0
 | 
					        uses: docker/build-push-action@v2.10.0
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          context: ./server
 | 
					          context: ./server
 | 
				
			||||||
          file: ./server/Dockerfile
 | 
					          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
 | 
					          platforms: linux/arm/v7,linux/amd64,linux/arm64
 | 
				
			||||||
          pull: true
 | 
					          push: ${{ github.event_name != 'pull_request' }}
 | 
				
			||||||
          push: true
 | 
					          tags: ${{ steps.previoustag.outputs.tag }}
 | 
				
			||||||
          tags: |
 | 
					          labels: ${{ steps.meta.outputs.labels }}
 | 
				
			||||||
            altran1502/immich-server:${{github.ref_name}}
 | 
					
 | 
				
			||||||
 | 
					  build_and_push_microservice_release:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - name: Checkout
 | 
				
			||||||
 | 
					        uses: actions/checkout@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          ref: "main" 
 | 
				
			||||||
 | 
					          fetch-depth: 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Docker meta
 | 
				
			||||||
 | 
					        id: meta
 | 
				
			||||||
 | 
					        uses: docker/metadata-action@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          images: altran1502/immich-microservices
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					      - name: 'Get Previous tag'
 | 
				
			||||||
 | 
					        id: previoustag
 | 
				
			||||||
 | 
					        uses: "WyriHaximus/github-action-get-previous-tag@v1"
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					            fallback: latest 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up QEMU
 | 
				
			||||||
 | 
					        uses: docker/setup-qemu-action@v1.2.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up Docker Buildx
 | 
				
			||||||
 | 
					        id: buildx
 | 
				
			||||||
 | 
					        uses: docker/setup-buildx-action@v1.6.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Login to Docker Hub
 | 
				
			||||||
 | 
					        uses: docker/login-action@v1
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          username: ${{ secrets.DOCKERHUB_USERNAME }}
 | 
				
			||||||
 | 
					          password: ${{ secrets.DOCKERHUB_TOKEN }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Build and push immich-microservices release
 | 
				
			||||||
 | 
					        uses: docker/build-push-action@v2.10.0
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          context: ./microservices
 | 
				
			||||||
 | 
					          file: ./microservices/Dockerfile
 | 
				
			||||||
 | 
					          platforms: linux/arm/v7,linux/amd64
 | 
				
			||||||
 | 
					          push: ${{ github.event_name != 'pull_request' }}
 | 
				
			||||||
 | 
					          tags: ${{ steps.previoustag.outputs.tag }}
 | 
				
			||||||
 | 
					          labels: ${{ steps.meta.outputs.labels }}
 | 
				
			||||||
@@ -10,9 +10,7 @@ services:
 | 
				
			|||||||
    expose:
 | 
					    expose:
 | 
				
			||||||
      - "3000"
 | 
					      - "3000"
 | 
				
			||||||
    volumes:
 | 
					    volumes:
 | 
				
			||||||
      - ../server:/usr/src/app
 | 
					 | 
				
			||||||
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
 | 
					      - ${UPLOAD_LOCATION}:/usr/src/app/upload
 | 
				
			||||||
      - /usr/src/app/node_modules
 | 
					 | 
				
			||||||
    env_file:
 | 
					    env_file:
 | 
				
			||||||
      - .env
 | 
					      - .env
 | 
				
			||||||
    environment:
 | 
					    environment:
 | 
				
			||||||
@@ -33,9 +31,7 @@ services:
 | 
				
			|||||||
    expose:
 | 
					    expose:
 | 
				
			||||||
      - "3001"
 | 
					      - "3001"
 | 
				
			||||||
    volumes:
 | 
					    volumes:
 | 
				
			||||||
      - ../microservices:/usr/src/app
 | 
					 | 
				
			||||||
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
 | 
					      - ${UPLOAD_LOCATION}:/usr/src/app/upload
 | 
				
			||||||
      - /usr/src/app/node_modules
 | 
					 | 
				
			||||||
    env_file:
 | 
					    env_file:
 | 
				
			||||||
      - .env
 | 
					      - .env
 | 
				
			||||||
    environment:
 | 
					    environment:
 | 
				
			||||||
@@ -84,27 +80,6 @@ services:
 | 
				
			|||||||
    depends_on:
 | 
					    depends_on:
 | 
				
			||||||
      - immich_server
 | 
					      - 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:
 | 
					networks:
 | 
				
			||||||
  immich_network:
 | 
					  immich_network:
 | 
				
			||||||
volumes:
 | 
					volumes:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@ class LoginForm extends HookConsumerWidget {
 | 
				
			|||||||
  Widget build(BuildContext context, WidgetRef ref) {
 | 
					  Widget build(BuildContext context, WidgetRef ref) {
 | 
				
			||||||
    final usernameController = useTextEditingController(text: 'testuser@email.com');
 | 
					    final usernameController = useTextEditingController(text: 'testuser@email.com');
 | 
				
			||||||
    final passwordController = useTextEditingController(text: 'password');
 | 
					    final passwordController = useTextEditingController(text: 'password');
 | 
				
			||||||
    final serverEndpointController = useTextEditingController(text: 'http://192.168.1.216:2283');
 | 
					    final serverEndpointController = useTextEditingController(text: 'http://192.168.1.103:2283');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return Center(
 | 
					    return Center(
 | 
				
			||||||
      child: ConstrainedBox(
 | 
					      child: ConstrainedBox(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user