File tree 8 files changed +44
-10
lines changed
8 files changed +44
-10
lines changed Original file line number Diff line number Diff line change 2
2
3
3
include librephotos.env
4
4
DOCKER_TAG ?= ownphotos-backend
5
- REPLACE_NAMES =sed 's/__backend_name__/$(BACKEND_CONT_NAME ) /g; s/__frontend_name__/$(FRONTEND_CONT_NAME ) /g; s/__proxy_name__/$(PROXY_CONT_NAME ) /g; s/__redis_name__/$(REDIS_CONT_NAME ) /g; s/__db_name__/$(DB_CONT_NAME ) /g; s/__pgadmin_name__/$(PGADMIN_CONT_NAME ) /g'
5
+ REPLACE_NAMES =sed 's/__backend_name__/$(BACKEND_CONT_NAME ) /g; s/__frontend_name__/$(FRONTEND_CONT_NAME ) /g; s/__proxy_name__/$(PROXY_CONT_NAME ) /g; s/__redis_name__/$(REDIS_CONT_NAME ) /g; s/__db_name__/$(DB_CONT_NAME ) /g; s/__pgadmin_name__/$(PGADMIN_CONT_NAME ) /g; s/__network_name__/ $( NETWORK_NAME ) /g '
6
6
7
7
default : build
8
8
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ services:
21
21
build:
22
22
context: ./proxy
23
23
dockerfile: Dockerfile
24
+ container_name: __proxy_name__
24
25
volumes:
25
26
- ${myPhotos}:/data
26
27
- ${proMedia}:/protected_media
@@ -30,9 +31,11 @@ services:
30
31
tty: true
31
32
environment:
32
33
- DEBUG=1
34
+ - WDS_SOCKET_PORT=0 # needed for webpack-dev-server
33
35
build:
34
36
context: ./frontend
35
37
dockerfile: Dockerfile.dev
38
+ container_name: __frontend_name__
36
39
volumes:
37
40
- ${codedir}/librephotos-frontend:/usr/src/app
38
41
@@ -46,6 +49,7 @@ services:
46
49
dockerfile: Dockerfile
47
50
args:
48
51
DEBUG: 1
52
+ container_name: __backend_name__
49
53
volumes:
50
54
- ${myPhotos}:/data
51
55
- ${proMedia}:/protected_media
@@ -59,11 +63,12 @@ services:
59
63
60
64
__pgadmin_name__:
61
65
image: dpage/pgadmin4
66
+ container_name: __pgadmin_name__
62
67
environment:
63
68
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:
[email protected] }
64
69
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
65
70
volumes:
66
- - $HOME /pgadmin:/root/.pgadmin
71
+ - ${pgAdminLocation} /pgadmin:/root/.pgadmin
67
72
ports:
68
73
- "3001:80"
69
74
restart: unless-stopped
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ services:
21
21
build :
22
22
context : ./proxy
23
23
dockerfile : Dockerfile
24
+ container_name : proxy
24
25
volumes :
25
26
- ${myPhotos}:/data
26
27
- ${proMedia}:/protected_media
@@ -34,6 +35,7 @@ services:
34
35
build :
35
36
context : ./frontend
36
37
dockerfile : Dockerfile.dev
38
+ container_name : frontend
37
39
volumes :
38
40
- ${codedir}/librephotos-frontend:/usr/src/app
39
41
@@ -47,6 +49,7 @@ services:
47
49
dockerfile : Dockerfile
48
50
args :
49
51
DEBUG : 1
52
+ container_name : backend
50
53
volumes :
51
54
- ${myPhotos}:/data
52
55
- ${proMedia}:/protected_media
@@ -60,11 +63,12 @@ services:
60
63
61
64
pgadmin :
62
65
image : dpage/pgadmin4
66
+ container_name : pgadmin
63
67
environment :
64
68
PGADMIN_DEFAULT_EMAIL :
${PGADMIN_DEFAULT_EMAIL:[email protected] }
65
69
PGADMIN_DEFAULT_PASSWORD : ${PGADMIN_DEFAULT_PASSWORD:-admin}
66
70
volumes :
67
- - $HOME /pgadmin:/root/.pgadmin
71
+ - ${pgAdminLocation} /pgadmin:/root/.pgadmin
68
72
ports :
69
73
- " 3001:80"
70
74
restart : unless-stopped
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ version: "3.8"
11
11
services:
12
12
__proxy_name__:
13
13
image: reallibrephotos/librephotos-proxy:${tag}
14
+ container_name: __proxy_name__
14
15
restart: unless-stopped
15
16
volumes:
16
17
- ${myPhotos}:/data
@@ -24,6 +25,7 @@ services:
24
25
25
26
__db_name__:
26
27
image: postgres:13
28
+ container_name: __db_name__
27
29
restart: unless-stopped
28
30
environment:
29
31
- POSTGRES_USER=${dbUser}
@@ -35,12 +37,14 @@ services:
35
37
36
38
__frontend_name__:
37
39
image: reallibrephotos/librephotos-frontend:${tag}
40
+ container_name: __frontend_name__
38
41
restart: unless-stopped
39
42
depends_on:
40
43
- __backend_name__
41
44
42
45
__backend_name__:
43
46
image: reallibrephotos/librephotos:${tag}
47
+ container_name: __backend_name__
44
48
restart: unless-stopped
45
49
volumes:
46
50
- ${myPhotos}:/data
@@ -75,4 +79,5 @@ services:
75
79
76
80
__redis_name__:
77
81
image: redis:6
82
+ container_name: __redis_name__
78
83
restart: unless-stopped
Original file line number Diff line number Diff line change @@ -11,10 +11,12 @@ version: "3.8"
11
11
services :
12
12
proxy :
13
13
image : reallibrephotos/librephotos-proxy:${tag}
14
+ container_name : proxy
14
15
restart : unless-stopped
15
16
volumes :
16
17
- ${myPhotos}:/data
17
18
- ${proMedia}:/protected_media
19
+ - ./proxy/nginx.conf:/etc/nginx/nginx.conf:ro
18
20
ports :
19
21
- ${httpPort}:80
20
22
depends_on :
@@ -23,6 +25,7 @@ services:
23
25
24
26
db :
25
27
image : postgres:13
28
+ container_name : db
26
29
restart : unless-stopped
27
30
environment :
28
31
- POSTGRES_USER=${dbUser}
@@ -34,12 +37,14 @@ services:
34
37
35
38
frontend :
36
39
image : reallibrephotos/librephotos-frontend:${tag}
40
+ container_name : frontend
37
41
restart : unless-stopped
38
42
depends_on :
39
43
- backend
40
44
41
45
backend :
42
46
image : reallibrephotos/librephotos:${tag}
47
+ container_name : backend
43
48
restart : unless-stopped
44
49
volumes :
45
50
- ${myPhotos}:/data
@@ -74,4 +79,5 @@ services:
74
79
75
80
redis :
76
81
image : redis:6
82
+ container_name : redis
77
83
restart : unless-stopped
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ shhhhKey=D2VymuMn2gAhx4tmAawd
42
42
43
43
# What port should Libre Photos be accessed at (Default 3000)
44
44
httpPort = 3000
45
-
46
45
# ------------------------------------------------------------------------------------------------
47
46
48
47
# Wow, we are at the optional now. Pretty easy so far. You do not have to change any of the below.
@@ -86,11 +85,20 @@ FRONTEND_CONT_NAME=frontend
86
85
PROXY_CONT_NAME = proxy
87
86
REDIS_CONT_NAME = redis
88
87
PGADMIN_CONT_NAME = pgadmin
88
+ NETWORK_NAME = libre-photos-net
89
89
90
90
# ---------------------------------------------------------------------------------------------
91
91
92
92
# If you are not a developer ignore the following parameters: you will never need them.
93
93
94
- # Where shall we store the backend and frontend code files.
94
+ # Where shall we store the backend and frontend code files.
95
95
codedir = ./librephotos/code
96
96
97
+ # Location for pgAdmin
98
+ pgAdminLocation = ./librephotos/pgadmin
99
+
100
+ # Which subnet should the docker network use
101
+ subnet = 172.19.0.0/16
102
+
103
+ # On which Gateway should the proxy container be accessible
104
+ gateway = 172.19.0.1
Original file line number Diff line number Diff line change @@ -28,12 +28,11 @@ http {
28
28
}
29
29
# needed for webpack-dev-server
30
30
location /ws {
31
- proxy_pass http://frontend:3000;
32
- proxy_http_version 1.1 ;
33
- proxy_set_header Upgrade $http_upgrade ;
34
- proxy_set_header Connection "upgrade" ;
31
+ proxy_pass http://frontend:3000;
32
+ proxy_http_version 1.1 ;
33
+ proxy_set_header Upgrade $http_upgrade ;
34
+ proxy_set_header Connection "upgrade" ;
35
35
}
36
-
37
36
# Django media
38
37
location /protected_media {
39
38
internal ;
Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ http {
26
26
include uwsgi_params;
27
27
proxy_pass http://__backend_name__:8001;
28
28
}
29
+ # needed for webpack-dev-server
30
+ location /ws {
31
+ proxy_pass http://__frontend_name__:3000;
32
+ proxy_http_version 1.1;
33
+ proxy_set_header Upgrade $http_upgrade;
34
+ proxy_set_header Connection "upgrade";
35
+ }
29
36
# Django media
30
37
location /protected_media {
31
38
internal;
You can’t perform that action at this time.
0 commit comments