Skip to content

Commit 4b8cc7b

Browse files
authoredJul 19, 2023
chore: docker compose for prod build (immich-app#3333)
* added docker compose for prod build * updated makefile
1 parent 6e953ff commit 4b8cc7b

File tree

2 files changed

+116
-2
lines changed

2 files changed

+116
-2
lines changed
 

‎Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ test-e2e:
2323
docker-compose -f ./docker/docker-compose.test.yml --env-file ./docker/.env.test -p immich-test-e2e up --renew-anon-volumes --abort-on-container-exit --exit-code-from immich-server-test --remove-orphans --build
2424

2525
prod:
26-
docker-compose -f ./docker/docker-compose.yml up --build -V --remove-orphans
26+
docker-compose -f ./docker/docker-compose.prod.yml up --build -V --remove-orphans
2727

2828
prod-scale:
29-
docker-compose -f ./docker/docker-compose.yml up --build -V --scale immich-server=3 --scale immich-microservices=3 --remove-orphans
29+
docker-compose -f ./docker/docker-compose.prod.yml up --build -V --scale immich-server=3 --scale immich-microservices=3 --remove-orphans
3030

3131
api:
3232
cd ./server && npm run api:generate

‎docker/docker-compose.prod.yml

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
version: "3.8"
2+
3+
services:
4+
immich-server:
5+
container_name: immich_server
6+
image: immich-server:latest
7+
build:
8+
context: ../server
9+
dockerfile: Dockerfile
10+
command: ["./start-server.sh"]
11+
volumes:
12+
- ${UPLOAD_LOCATION}:/usr/src/app/upload
13+
env_file:
14+
- .env
15+
depends_on:
16+
- redis
17+
- database
18+
- typesense
19+
20+
immich-machine-learning:
21+
container_name: immich_machine_learning
22+
image: immich-machine-learning:latest
23+
build:
24+
context: ../machine-learning
25+
dockerfile: Dockerfile
26+
volumes:
27+
- ${UPLOAD_LOCATION}:/usr/src/app/upload
28+
- model-cache:/cache
29+
env_file:
30+
- .env
31+
restart: always
32+
33+
immich-microservices:
34+
container_name: immich_microservices
35+
image: immich-microservices:latest
36+
build:
37+
context: ../server
38+
dockerfile: Dockerfile
39+
command: ["./start-microservices.sh"]
40+
volumes:
41+
- ${UPLOAD_LOCATION}:/usr/src/app/upload
42+
env_file:
43+
- .env
44+
depends_on:
45+
- database
46+
- immich-server
47+
- typesense
48+
restart: always
49+
50+
immich-web:
51+
container_name: immich_web
52+
image: immich-web:latest
53+
build:
54+
context: ../web
55+
dockerfile: Dockerfile
56+
env_file:
57+
- .env
58+
restart: always
59+
depends_on:
60+
- immich-server
61+
62+
typesense:
63+
container_name: immich_typesense
64+
image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
65+
environment:
66+
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
67+
- TYPESENSE_DATA_DIR=/data
68+
logging:
69+
driver: none
70+
volumes:
71+
- tsdata:/data
72+
restart: always
73+
74+
redis:
75+
container_name: immich_redis
76+
image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
77+
restart: always
78+
79+
database:
80+
container_name: immich_postgres
81+
image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
82+
env_file:
83+
- .env
84+
environment:
85+
POSTGRES_PASSWORD: ${DB_PASSWORD}
86+
POSTGRES_USER: ${DB_USERNAME}
87+
POSTGRES_DB: ${DB_DATABASE_NAME}
88+
PG_DATA: /var/lib/postgresql/data
89+
volumes:
90+
- pgdata:/var/lib/postgresql/data
91+
restart: always
92+
93+
immich-proxy:
94+
container_name: immich_proxy
95+
image: immich-proxy:latest
96+
environment:
97+
# Make sure these values get passed through from the env file
98+
- IMMICH_SERVER_URL
99+
- IMMICH_WEB_URL
100+
build:
101+
context: ../nginx
102+
dockerfile: Dockerfile
103+
ports:
104+
- 2283:8080
105+
logging:
106+
driver: none
107+
depends_on:
108+
- immich-server
109+
restart: always
110+
111+
volumes:
112+
pgdata:
113+
model-cache:
114+
tsdata:

0 commit comments

Comments
 (0)