Skip to content

Commit 2bf22c8

Browse files
committed
Docker compose enviroment variables in .env file
1 parent e1a96e4 commit 2bf22c8

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ backend/src/main/resources/static/*
22
backend/bin/src/main/resources/keystore.jks
33
backend/bin/src/main/resources/static/*
44
backend/src/main/resources/static/*
5-
*.class
5+
*.class
6+
docker/composed/.env
-37 Bytes
Binary file not shown.

docker/composed/docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ services:
77
ports:
88
- "4443:4443"
99
environment:
10-
openvidu.secret: SECRET
10+
openvidu.secret: ${OPENVIDU_SECRET}
1111

1212
openvidu-teaching:
1313
image: diegomzmn/openviduteaching:latest
1414
volumes:
15-
- /path/to/initialData.json:/initialData.json
15+
- ${LOCAL_INITIAL_FILE_PATH}:${DOCKER_INITIAL_FILE_PATH}
1616
ports:
1717
- "8080:8080"
1818
environment:
19-
openvidu.url: https://192.168.1.38:4443/
20-
openvidu.secret: SECRET
21-
initialDataFile: /initialData.json
19+
openvidu.url: https://${OPENVIDU_SERVER_IP}:4443/
20+
openvidu.secret: ${OPENVIDU_SECRET}
21+
initialDataFile: ${DOCKER_INITIAL_FILE_PATH}

documentation/deploy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ You have three options for deploying the app:
6262

6363
### OpenViduTeaching Docker container + Openvidu+KMS Docker container ###
6464

65-
* You can simply make a docker-compose.yml. Take [this one](https://github.com/codeurjc-students/2019-OpenViduTeaching/blob/master/docker/composed/docker-compose.yml) as an example. You have to set the ports as specified (you can change 8080 in openvidu-teaching), mount the volume and use an enviroment variable for the path (same as in first option). You MUST use the variable for the url (localhost will not work).
65+
* You can simply make a docker-compose.yml. Take [this one](https://github.com/codeurjc-students/2019-OpenViduTeaching/blob/master/docker/composed/docker-compose.yml) as an example. You have to set the ports as specified (you can change 8080 in openvidu-teaching), mount the volume and use an enviroment variable for the path (same as in first option). You MUST use the variable for the url (localhost will not work). You can use a .env file for the enviroment variables, as in the example, or just write them in the .yml. Using a .env file is highly encouraged, at least for the OpenVidu Secret, because it is the unique password for the OpenVidu Server.
6666

6767
* You can also start both manually. Here's how you run both independently with the same configuration as in the compose example.
6868
`docker run -p 4443:4443 --rm -e openvidu.secret=SECRET openvidu/openvidu-server-kms:2.11.0`

frontend/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)