Skip to content

Commit

Permalink
feat: create immich-nginx container to remove default nginx config se…
Browse files Browse the repository at this point in the history
…tup (immich-app#280)

* feat: create immich-proxy container to remove default nginx config setup

* infra: make production docker-compose point at release builds for stability

* Fixed nginx config file was overriden by default.conf in nginx container; Fixed docker-compose.dev; Added additional tag 'release' for tagging after release build in Github Action

Co-authored-by: Alex Tran <[email protected]>
  • Loading branch information
zackpollard and alextran1502 authored Jun 30, 2022
1 parent a2e1d4c commit 142ede3
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 23 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build_push_docker_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,30 @@ jobs:
push: true
tags: |
altran1502/immich-web:latest
build_and_push_nginx_latest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Proxy
uses: docker/[email protected]
with:
context: ./nginx
file: ./nginx/Dockerfile
platforms: linux/arm/v7,linux/amd64,linux/arm64
push: true
tags: |
altran1502/immich-proxy:latest
27 changes: 27 additions & 0 deletions .github/workflows/build_push_docker_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,30 @@ jobs:
push: ${{ github.event_name == 'pull_request' }}
tags: |
altran1502/immich-web:staging
build_and_push_nginx_staging:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Proxy
uses: docker/[email protected]
with:
context: ./nginx
file: ./nginx/Dockerfile
platforms: linux/arm/v7,linux/amd64,linux/arm64
push: ${{ github.event_name == 'pull_request' }}
tags: |
altran1502/immich-proxy:staging
42 changes: 42 additions & 0 deletions .github/workflows/build_push_server_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: |
altran1502/immich-server:${{ steps.previoustag.outputs.tag }}
altran1502/immich-server:release
build_and_push_machine_learning_release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -75,6 +76,7 @@ jobs:
push: true
tags: |
altran1502/immich-machine-learning:${{ steps.previoustag.outputs.tag }}
altran1502/immich-machine-learning:release
build_and_push_web_release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -114,3 +116,43 @@ jobs:
target: prod
tags: |
altran1502/immich-web:${{ steps.previoustag.outputs.tag }}
altran1502/immich-web:release
build_and_push_nginx_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "main"
fetch-depth: 0

- name: "Get Previous tag"
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: latest

- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push immich-proxy release
uses: docker/[email protected]
with:
context: ./web
file: ./web/Dockerfile
platforms: linux/arm/v7,linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
altran1502/immich-proxy:release
altran1502/immich-proxy:${{ steps.previoustag.outputs.tag }}
16 changes: 7 additions & 9 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ services:
context: ../server
dockerfile: Dockerfile
command: npm run start:dev immich
expose:
- "3000"
volumes:
- ../server:/usr/src/app
- ${UPLOAD_LOCATION}:/usr/src/app/upload
Expand All @@ -27,8 +25,6 @@ services:
context: ../machine-learning
dockerfile: Dockerfile
command: npm run start:dev
expose:
- "3001"
volumes:
- ../machine-learning:/usr/src/app
- ${UPLOAD_LOCATION}:/usr/src/app/upload
Expand Down Expand Up @@ -94,18 +90,20 @@ services:
ports:
- 5432:5432

nginx:
container_name: proxy_nginx
image: nginx:latest
volumes:
- ./settings/nginx-conf:/etc/nginx/conf.d
immich-proxy:
container_name: immich_proxy
image: immich-proxy-dev:latest
build:
context: ../nginx
dockerfile: Dockerfile
ports:
- 2283:80
- 2284:443
logging:
driver: none
depends_on:
- immich-server
restart: always

volumes:
pgdata:
8 changes: 3 additions & 5 deletions docker/docker-compose.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ services:
- pgdata:/var/lib/postgresql/data
restart: always

nginx:
container_name: proxy_nginx
image: nginx:latest
volumes:
- ./settings/nginx-conf:/etc/nginx/conf.d
immich-proxy:
container_name: immich_proxy
image: altran1502/immich-proxy:staging
ports:
- 2283:80
- 2284:443
Expand Down
16 changes: 7 additions & 9 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
immich-server:
image: altran1502/immich-server:latest
image: altran1502/immich-server:release
entrypoint: ["/bin/sh", "./start-server.sh"]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
Expand All @@ -16,7 +16,7 @@ services:
restart: always

immich-microservices:
image: altran1502/immich-server:latest
image: altran1502/immich-server:release
entrypoint: ["/bin/sh", "./start-microservices.sh"]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
Expand All @@ -30,7 +30,7 @@ services:
restart: always

immich-machine-learning:
image: altran1502/immich-machine-learning:latest
image: altran1502/immich-machine-learning:release
entrypoint: ["/bin/sh", "./entrypoint.sh"]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
Expand All @@ -43,7 +43,7 @@ services:
restart: always

immich-web:
image: altran1502/immich-web:latest
image: altran1502/immich-web:release
entrypoint: ["/bin/sh", "./entrypoint.sh"]
env_file:
- .env
Expand All @@ -68,11 +68,9 @@ services:
- pgdata:/var/lib/postgresql/data
restart: always

nginx:
container_name: proxy_nginx
image: nginx:latest
volumes:
- ./settings/nginx-conf:/etc/nginx/conf.d
immich-proxy:
container_name: immich_proxy
image: altran1502/immich-proxy:release
ports:
- 2283:80
- 2284:443
Expand Down
3 changes: 3 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM nginx:latest

COPY nginx.conf /etc/nginx/conf.d/default.conf
File renamed without changes.

0 comments on commit 142ede3

Please sign in to comment.