Skip to content

Commit 58c3c7e

Browse files
authored
feat: run e2e server in dev mode (#23921)
* feat: run e2e server in dev mode * Use bash syntax: [[ and ==
1 parent 237ddcb commit 58c3c7e

File tree

3 files changed

+109
-1
lines changed

3 files changed

+109
-1
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ dev-docs:
1717
e2e:
1818
@trap 'make e2e-down' EXIT; COMPOSE_BAKE=true docker compose -f ./e2e/docker-compose.yml up --remove-orphans
1919

20+
e2e-dev:
21+
@trap 'make e2e-down' EXIT; COMPOSE_BAKE=true docker compose -f ./e2e/docker-compose.dev.yml up --remove-orphans
22+
2023
e2e-update:
2124
@trap 'make e2e-down' EXIT; COMPOSE_BAKE=true docker compose -f ./e2e/docker-compose.yml up --build -V --remove-orphans
2225

e2e/docker-compose.dev.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: immich-e2e
2+
3+
services:
4+
immich-server:
5+
container_name: immich-e2e-server
6+
command: ['immich-dev']
7+
image: immich-server-dev:latest
8+
build:
9+
context: ../
10+
dockerfile: server/Dockerfile.dev
11+
target: dev
12+
environment:
13+
- DB_HOSTNAME=database
14+
- DB_USERNAME=postgres
15+
- DB_PASSWORD=postgres
16+
- DB_DATABASE_NAME=immich
17+
- IMMICH_MACHINE_LEARNING_ENABLED=false
18+
- IMMICH_TELEMETRY_INCLUDE=all
19+
- IMMICH_ENV=testing
20+
- IMMICH_PORT=2285
21+
- IMMICH_IGNORE_MOUNT_CHECK_ERRORS=true
22+
volumes:
23+
- ./test-assets:/test-assets
24+
- ..:/usr/src/app
25+
- ${UPLOAD_LOCATION}/photos:/data
26+
- /etc/localtime:/etc/localtime:ro
27+
- pnpm-store:/usr/src/app/.pnpm-store
28+
- server-node_modules:/usr/src/app/server/node_modules
29+
- web-node_modules:/usr/src/app/web/node_modules
30+
- github-node_modules:/usr/src/app/.github/node_modules
31+
- cli-node_modules:/usr/src/app/cli/node_modules
32+
- docs-node_modules:/usr/src/app/docs/node_modules
33+
- e2e-node_modules:/usr/src/app/e2e/node_modules
34+
- sdk-node_modules:/usr/src/app/open-api/typescript-sdk/node_modules
35+
- app-node_modules:/usr/src/app/node_modules
36+
- sveltekit:/usr/src/app/web/.svelte-kit
37+
- coverage:/usr/src/app/web/coverage
38+
- ../plugins:/build/corePlugin
39+
depends_on:
40+
redis:
41+
condition: service_started
42+
database:
43+
condition: service_healthy
44+
45+
immich-web:
46+
container_name: immich-e2e-web
47+
image: immich-web-dev:latest
48+
build:
49+
context: ../
50+
dockerfile: server/Dockerfile.dev
51+
target: dev
52+
command: ['immich-web']
53+
ports:
54+
- 2285:3000
55+
environment:
56+
- IMMICH_SERVER_URL=http://immich-server:2285/
57+
volumes:
58+
- ..:/usr/src/app
59+
- pnpm-store:/usr/src/app/.pnpm-store
60+
- server-node_modules:/usr/src/app/server/node_modules
61+
- web-node_modules:/usr/src/app/web/node_modules
62+
- github-node_modules:/usr/src/app/.github/node_modules
63+
- cli-node_modules:/usr/src/app/cli/node_modules
64+
- docs-node_modules:/usr/src/app/docs/node_modules
65+
- e2e-node_modules:/usr/src/app/e2e/node_modules
66+
- sdk-node_modules:/usr/src/app/open-api/typescript-sdk/node_modules
67+
- app-node_modules:/usr/src/app/node_modules
68+
- sveltekit:/usr/src/app/web/.svelte-kit
69+
- coverage:/usr/src/app/web/coverage
70+
restart: unless-stopped
71+
72+
redis:
73+
image: redis:6.2-alpine@sha256:37e002448575b32a599109664107e374c8709546905c372a34d64919043b9ceb
74+
75+
database:
76+
image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0@sha256:6f3e9d2c2177af16c2988ff71425d79d89ca630ec2f9c8db03209ab716542338
77+
command: -c fsync=off -c shared_preload_libraries=vchord.so -c config_file=/var/lib/postgresql/data/postgresql.conf
78+
environment:
79+
POSTGRES_PASSWORD: postgres
80+
POSTGRES_USER: postgres
81+
POSTGRES_DB: immich
82+
ports:
83+
- 5435:5432
84+
healthcheck:
85+
test: ['CMD-SHELL', 'pg_isready -U postgres -d immich']
86+
interval: 1s
87+
timeout: 5s
88+
retries: 30
89+
start_period: 10s
90+
91+
volumes:
92+
model-cache:
93+
prometheus-data:
94+
grafana-data:
95+
pnpm-store:
96+
server-node_modules:
97+
web-node_modules:
98+
github-node_modules:
99+
cli-node_modules:
100+
docs-node_modules:
101+
e2e-node_modules:
102+
sdk-node_modules:
103+
app-node_modules:
104+
sveltekit:
105+
coverage:

server/bin/immich-dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
if [ "$IMMICH_ENV" != "development" ]; then
3+
if [[ "$IMMICH_ENV" == "production" ]]; then
44
echo "This command can only be run in development environments"
55
exit 1
66
fi

0 commit comments

Comments
 (0)