Skip to content

Commit 330d71c

Browse files
committed
#1
0 parents  commit 330d71c

File tree

3 files changed

+157
-0
lines changed

3 files changed

+157
-0
lines changed

.github/workflows/ubuntu.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Immich Setup & Verification
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
inputs:
7+
K_SECONDS:
8+
description: 'Duration in seconds to sleep before verification'
9+
required: true
10+
default: '90' # Immich can take a bit longer to fully initialize
11+
type: string
12+
13+
jobs:
14+
setup_and_verify_immich:
15+
runs-on: ubuntu-24.04 # Specifies the base Ubuntu 24.04 image
16+
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@v4
20+
21+
- name: Install Docker and Docker Compose
22+
uses: docker/setup-buildx-action@v3 # This action conveniently installs Docker and Docker Compose v2 (docker compose)
23+
24+
- name: Start Immich services
25+
# Change working-directory to where your docker-compose.yml and .env are located
26+
working-directory: docker-configs/immich
27+
run: |
28+
echo "Starting Immich services with docker compose from $(pwd)..."
29+
# Ensure volumes are created if not already
30+
docker compose pull # Pull images first to ensure they are the specified version
31+
docker compose up -d
32+
33+
- name: Wait for Immich to fully initialize
34+
run: |
35+
K_SECONDS="${{ github.event.inputs.K_SECONDS }}"
36+
echo "Sleeping for $K_SECONDS seconds before verification..."
37+
sleep "$K_SECONDS"
38+
echo "Sleep finished, proceeding to verification."
39+
40+
- name: Verify Immich API is up and running
41+
run: |
42+
echo "Verifying Immich API..."
43+
# The API server runs on IMMICH_SERVER_PORT (2283 by default) as defined in .env
44+
curl -f -s http://localhost:2283/api/server-info
45+
if [ $? -eq 0 ]; then
46+
echo "Immich API service is up and running!"
47+
else
48+
echo "Immich API service failed to respond!"
49+
exit 1
50+
fi
51+
52+
- name: Verify Immich Web UI is accessible
53+
run: |
54+
echo "Verifying Immich Web UI..."
55+
# The web UI runs on IMMICH_WEB_PORT (8080 by default) as defined in .env
56+
curl -f -s http://localhost:8080/
57+
if [ $? -eq 0 ]; then
58+
echo "Immich Web UI is accessible!"
59+
else
60+
echo "Immich Web UI failed to respond!"
61+
exit 1
62+
fi
63+
64+
- name: Display running Docker containers (for debugging)
65+
if: always() # Run even if previous steps fail
66+
run: docker ps -a
67+
68+
- name: Display Docker Compose logs (for debugging)
69+
if: always() # Run even if previous steps fail
70+
working-directory: docker-configs/immich
71+
run: docker compose logs

docker-configs/immich/.env

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Database settings
2+
DB_HOSTNAME=postgres
3+
DB_USERNAME=immich
4+
DB_PASSWORD=immich_secure_password # IMPORTANT: Use a strong password in production
5+
DB_DATABASE=immich_db
6+
7+
# Redis settings
8+
# REDIS_HOSTNAME=redis
9+
#
10+
# # Immich ports (exposed on the host)
11+
# IMMICH_WEB_PORT=8080 # For the web interface
12+
# IMMICH_SERVER_PORT=2283 # For the API backend
13+
#
14+
# # Internal container path for uploads (mapped via volume)
15+
# UPLOAD_LOCATION=/usr/src/app/upload
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
version: '3.8'
2+
3+
services:
4+
immich-server:
5+
container_name: immich_server
6+
image: ghcr.io/immich-app/immich-server:release
7+
command: ["start-server.sh"]
8+
volumes:
9+
- immich_upload:/usr/src/app/upload # This must match UPLOAD_LOCATION in .env
10+
env_file:
11+
- .env
12+
ports:
13+
- ${IMMICH_SERVER_PORT}:${IMMICH_SERVER_PORT}
14+
depends_on:
15+
- postgres
16+
- redis
17+
restart: always
18+
19+
immich-microservices:
20+
container_name: immich_microservices
21+
image: ghcr.io/immich-app/immich-microservices:release
22+
env_file:
23+
- .env
24+
depends_on:
25+
- postgres
26+
- redis
27+
- immich-server
28+
restart: always
29+
30+
immich-web:
31+
container_name: immich_web
32+
image: ghcr.io/immich-app/immich-web:release
33+
env_file:
34+
- .env
35+
ports:
36+
- ${IMMICH_WEB_PORT}:${IMMICH_WEB_PORT}
37+
depends_on:
38+
- immich-server
39+
restart: always
40+
41+
immich-machine-learning:
42+
container_name: immich_machine_learning
43+
image: ghcr.io/immich-app/immich-machine-learning:release
44+
env_file:
45+
- .env
46+
volumes:
47+
- immich_ml:/usr/src/app/models
48+
restart: always
49+
50+
redis:
51+
container_name: immich_redis
52+
image: redis:6.2-alpine
53+
restart: always
54+
55+
postgres:
56+
container_name: immich_postgres
57+
image: postgres:14-alpine
58+
env_file:
59+
- .env
60+
environment:
61+
POSTGRES_USER: ${DB_USERNAME}
62+
POSTGRES_PASSWORD: ${DB_PASSWORD}
63+
POSTGRES_DB: ${DB_DATABASE}
64+
volumes:
65+
- immich_pg:/var/lib/postgresql/data
66+
restart: always
67+
68+
volumes:
69+
immich_pg:
70+
immich_upload:
71+
immich_ml:

0 commit comments

Comments
 (0)