Skip to content

Commit 5bdbe23

Browse files
committed
Migra para .env as variaveis
Signed-off-by: henmohr <henriquemohr@redes.ufsm.br>
1 parent 342234f commit 5bdbe23

File tree

4 files changed

+84
-45
lines changed

4 files changed

+84
-45
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

README.en-US.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,58 @@ This repository adds:
1818

1919
Use the same host for Nextcloud and `notify_push`, and route `/push/` to the push service.
2020

21+
Copy the compose example and adjust the values in the `.env` file.
22+
2123
Example using the generic domain `cloud.example.com`:
2224

2325
```yaml
2426
services:
2527
nextcloud:
26-
image: nextcloud:apache
28+
image: ${NEXTCLOUD_IMAGE}
2729
environment:
28-
VIRTUAL_HOST: cloud.example.com
29-
VIRTUAL_PATH: /
30+
VIRTUAL_HOST: ${VIRTUAL_HOST}
31+
VIRTUAL_PATH: ${NEXTCLOUD_VIRTUAL_PATH}
3032
networks:
3133
- reverse-proxy
3234
- internal
3335

3436
notify_push:
35-
image: ghcr.io/librecodecoop/nextcloud-notify-push-docker:latest
37+
image: ${NOTIFY_PUSH_IMAGE}
3638
environment:
37-
PORT: "7867"
38-
NEXTCLOUD_URL: "https://cloud.example.com"
39-
REDIS_URL: "redis://redis:6379/0"
40-
DATABASE_URL: "postgres://nextcloud:secret@postgres/nextcloud"
41-
DATABASE_PREFIX: ""
42-
LOG: "info"
43-
VIRTUAL_HOST: cloud.example.com
44-
VIRTUAL_PATH: /push/
45-
VIRTUAL_DEST: /
46-
VIRTUAL_PORT: "7867"
39+
PORT: "${NOTIFY_PUSH_PORT}"
40+
NEXTCLOUD_URL: "${NEXTCLOUD_URL}"
41+
REDIS_URL: "${REDIS_URL}"
42+
DATABASE_URL: "${DATABASE_URL}"
43+
DATABASE_PREFIX: "${DATABASE_PREFIX}"
44+
LOG: "${NOTIFY_PUSH_LOG}"
45+
VIRTUAL_HOST: ${VIRTUAL_HOST}
46+
VIRTUAL_PATH: ${NOTIFY_PUSH_VIRTUAL_PATH}
47+
VIRTUAL_DEST: ${NOTIFY_PUSH_VIRTUAL_DEST}
48+
VIRTUAL_PORT: "${NOTIFY_PUSH_PORT}"
4749
expose:
48-
- "7867"
50+
- "${NOTIFY_PUSH_PORT}"
4951
networks:
5052
- reverse-proxy
5153
- internal
5254
```
5355
56+
Example `.env`:
57+
58+
```dotenv
59+
NEXTCLOUD_IMAGE=nextcloud:apache
60+
NOTIFY_PUSH_IMAGE=ghcr.io/librecodecoop/nextcloud-notify-push-docker:latest
61+
VIRTUAL_HOST=cloud.example.com
62+
NEXTCLOUD_VIRTUAL_PATH=/
63+
NOTIFY_PUSH_PORT=7867
64+
NEXTCLOUD_URL=https://cloud.example.com
65+
REDIS_URL=redis://redis:6379/0
66+
DATABASE_URL=postgres://nextcloud:secret@postgres/nextcloud
67+
DATABASE_PREFIX=
68+
NOTIFY_PUSH_LOG=info
69+
NOTIFY_PUSH_VIRTUAL_PATH=/push/
70+
NOTIFY_PUSH_VIRTUAL_DEST=/
71+
```
72+
5473
Important details:
5574

5675
- `notify_push` must be attached to the same Docker network as `nginx-proxy`

README.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,58 @@ Este repositorio adiciona:
1818

1919
Use o mesmo host para o Nextcloud e para o `notify_push`, roteando `/push/` para o servico de push.
2020

21+
Copie o exemplo de compose e ajuste os valores no arquivo `.env`.
22+
2123
Exemplo usando o dominio generico `cloud.example.com`:
2224

2325
```yaml
2426
services:
2527
nextcloud:
26-
image: nextcloud:apache
28+
image: ${NEXTCLOUD_IMAGE}
2729
environment:
28-
VIRTUAL_HOST: cloud.example.com
29-
VIRTUAL_PATH: /
30+
VIRTUAL_HOST: ${VIRTUAL_HOST}
31+
VIRTUAL_PATH: ${NEXTCLOUD_VIRTUAL_PATH}
3032
networks:
3133
- reverse-proxy
3234
- internal
3335

3436
notify_push:
35-
image: ghcr.io/librecodecoop/nextcloud-notify-push-docker:latest
37+
image: ${NOTIFY_PUSH_IMAGE}
3638
environment:
37-
PORT: "7867"
38-
NEXTCLOUD_URL: "https://cloud.example.com"
39-
REDIS_URL: "redis://redis:6379/0"
40-
DATABASE_URL: "postgres://nextcloud:secret@postgres/nextcloud"
41-
DATABASE_PREFIX: ""
42-
LOG: "info"
43-
VIRTUAL_HOST: cloud.example.com
44-
VIRTUAL_PATH: /push/
45-
VIRTUAL_DEST: /
46-
VIRTUAL_PORT: "7867"
39+
PORT: "${NOTIFY_PUSH_PORT}"
40+
NEXTCLOUD_URL: "${NEXTCLOUD_URL}"
41+
REDIS_URL: "${REDIS_URL}"
42+
DATABASE_URL: "${DATABASE_URL}"
43+
DATABASE_PREFIX: "${DATABASE_PREFIX}"
44+
LOG: "${NOTIFY_PUSH_LOG}"
45+
VIRTUAL_HOST: ${VIRTUAL_HOST}
46+
VIRTUAL_PATH: ${NOTIFY_PUSH_VIRTUAL_PATH}
47+
VIRTUAL_DEST: ${NOTIFY_PUSH_VIRTUAL_DEST}
48+
VIRTUAL_PORT: "${NOTIFY_PUSH_PORT}"
4749
expose:
48-
- "7867"
50+
- "${NOTIFY_PUSH_PORT}"
4951
networks:
5052
- reverse-proxy
5153
- internal
5254
```
5355
56+
Exemplo de `.env`:
57+
58+
```dotenv
59+
NEXTCLOUD_IMAGE=nextcloud:apache
60+
NOTIFY_PUSH_IMAGE=ghcr.io/librecodecoop/nextcloud-notify-push-docker:latest
61+
VIRTUAL_HOST=cloud.example.com
62+
NEXTCLOUD_VIRTUAL_PATH=/
63+
NOTIFY_PUSH_PORT=7867
64+
NEXTCLOUD_URL=https://cloud.example.com
65+
REDIS_URL=redis://redis:6379/0
66+
DATABASE_URL=postgres://nextcloud:secret@postgres/nextcloud
67+
DATABASE_PREFIX=
68+
NOTIFY_PUSH_LOG=info
69+
NOTIFY_PUSH_VIRTUAL_PATH=/push/
70+
NOTIFY_PUSH_VIRTUAL_DEST=/
71+
```
72+
5473
Pontos importantes:
5574

5675
- o `notify_push` precisa estar na mesma rede Docker do `nginx-proxy`

docker-compose.example.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
services:
22
nextcloud:
3-
image: nextcloud:apache
3+
image: ${NEXTCLOUD_IMAGE}
44
environment:
5-
VIRTUAL_HOST: cloud.example.com
6-
VIRTUAL_PATH: /
5+
VIRTUAL_HOST: ${VIRTUAL_HOST}
6+
VIRTUAL_PATH: ${NEXTCLOUD_VIRTUAL_PATH}
77
networks:
88
- reverse-proxy
99
- internal
1010

1111
notify_push:
12-
image: ghcr.io/librecodecoop/nextcloud-notify-push-docker:latest
12+
image: ${NOTIFY_PUSH_IMAGE}
1313
environment:
14-
PORT: "7867"
15-
NEXTCLOUD_URL: "https://cloud.example.com"
16-
REDIS_URL: "redis://redis:6379/0"
17-
DATABASE_URL: "postgres://nextcloud:secret@postgres/nextcloud"
18-
DATABASE_PREFIX: ""
19-
LOG: "info"
20-
VIRTUAL_HOST: cloud.example.com
21-
VIRTUAL_PATH: /push/
22-
VIRTUAL_DEST: /
23-
VIRTUAL_PORT: "7867"
14+
PORT: "${NOTIFY_PUSH_PORT}"
15+
NEXTCLOUD_URL: "${NEXTCLOUD_URL}"
16+
REDIS_URL: "${REDIS_URL}"
17+
DATABASE_URL: "${DATABASE_URL}"
18+
DATABASE_PREFIX: "${DATABASE_PREFIX}"
19+
LOG: "${NOTIFY_PUSH_LOG}"
20+
VIRTUAL_HOST: ${VIRTUAL_HOST}
21+
VIRTUAL_PATH: ${NOTIFY_PUSH_VIRTUAL_PATH}
22+
VIRTUAL_DEST: ${NOTIFY_PUSH_VIRTUAL_DEST}
23+
VIRTUAL_PORT: "${NOTIFY_PUSH_PORT}"
2424
expose:
25-
- "7867"
25+
- "${NOTIFY_PUSH_PORT}"
2626
networks:
2727
- reverse-proxy
2828
- internal

0 commit comments

Comments
 (0)