Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 4e4329b

Browse files
authored
Merge pull request #1366 from soedar/eg-env-var
Moved customizable env variables to .env file
2 parents cb7e8ae + e90a91f commit 4e4329b

File tree

3 files changed

+46
-40
lines changed

3 files changed

+46
-40
lines changed

examples/compose/.env

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
MACHINE_FQDN=172.17.0.1
1+
MACHINE_FQDN=172.17.0.1
2+
3+
SECRET_KEY_BASE=b494a25faa8d22e430e843e220e424e10ac84d2ce0e64231f5b636d21251eb6d267adb042ad5884cbff0f3891bcf911bdf8abb3ce719849ccda9a4889249e5c2
4+
PORTUS_PASSWORD=12341234
5+
DATABASE_PASSWORD=portus

examples/compose/docker-compose.insecure.yml

+22-20
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ services:
44
portus:
55
image: opensuse/portus:head
66
environment:
7-
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
8-
- PORTUS_CHECK_SSL_USAGE_ENABLED=false
7+
PORTUS_MACHINE_FQDN_VALUE: ${MACHINE_FQDN}
98

109
# DB. The password for the database should definitely not be here. You are
1110
# probably better off with Docker Swarm secrets.
12-
- PORTUS_PRODUCTION_HOST=db
13-
- PORTUS_PRODUCTION_PASSWORD=portus
14-
- PORTUS_PRODUCTION_DATABASE=portus_production
11+
PORTUS_PRODUCTION_HOST: db
12+
PORTUS_PRODUCTION_DATABASE: portus_production
13+
PORTUS_PRODUCTION_PASSWORD: ${DATABASE_PASSWORD}
1514

1615
# Secrets. It can possibly be handled better with Swarm's secrets.
17-
- PORTUS_SECRET_KEY_BASE=b494a25faa8d22e430e843e220e424e10ac84d2ce0e64231f5b636d21251eb6d267adb042ad5884cbff0f3891bcf911bdf8abb3ce719849ccda9a4889249e5c2
18-
- PORTUS_KEY_PATH=/certificates/portus.key
19-
- PORTUS_PASSWORD=12341234
16+
PORTUS_SECRET_KEY_BASE: ${SECRET_KEY_BASE}
17+
PORTUS_KEY_PATH: /certificates/portus.key
18+
PORTUS_PASSWORD: ${PORTUS_PASSWORD}
2019

21-
# NGinx is serving the assets instead of Puma. If you want to change this,
22-
# uncomment this line.
23-
- RAILS_SERVE_STATIC_FILES=true
20+
# SSL
21+
PORTUS_CHECK_SSL_USAGE_ENABLED: 'false'
22+
23+
# Since we have no nginx in insecure mode, portus have to
24+
# serve the static files
25+
RAILS_SERVE_STATIC_FILES: 'true'
2426
ports:
2527
- 3000:3000
2628
links:
@@ -31,21 +33,21 @@ services:
3133
crono:
3234
image: opensuse/portus:head
3335
environment:
34-
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
36+
PORTUS_MACHINE_FQDN_VALUE: ${MACHINE_FQDN}
3537

3638
# DB. The password for the database should definitely not be here. You are
3739
# probably better off with Docker Swarm secrets.
38-
- PORTUS_PRODUCTION_HOST=db
39-
- PORTUS_PRODUCTION_DATABASE=portus_production
40-
- PORTUS_PRODUCTION_PASSWORD=portus
40+
PORTUS_PRODUCTION_HOST: db
41+
PORTUS_PRODUCTION_DATABASE: portus_production
42+
PORTUS_PRODUCTION_PASSWORD: ${DATABASE_PASSWORD}
4143

4244
# Secrets. It can possibly be handled better with Swarm's secrets.
43-
- PORTUS_SECRET_KEY_BASE=b494a25faa8d22e430e843e220e424e10ac84d2ce0e64231f5b636d21251eb6d267adb042ad5884cbff0f3891bcf911bdf8abb3ce719849ccda9a4889249e5c2
44-
- PORTUS_KEY_PATH=/certificates/portus.key
45-
- PORTUS_PASSWORD=12341234
45+
PORTUS_SECRET_KEY_BASE: ${SECRET_KEY_BASE}
46+
PORTUS_KEY_PATH: /certificates/portus.key
47+
PORTUS_PASSWORD: ${PORTUS_PASSWORD}
4648

4749
# We want to execute crono, not portus
48-
- PORTUS_INIT_COMMAND=bin/crono
50+
PORTUS_INIT_COMMAND: bin/crono
4951
links:
5052
- db
5153
volumes:
@@ -57,7 +59,7 @@ services:
5759
MYSQL_DATABASE: portus_production
5860

5961
# Again, the password shouldn't be handled like this.
60-
MYSQL_ROOT_PASSWORD: portus
62+
MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD}
6163
volumes:
6264
- /var/lib/portus/mariadb:/var/lib/mysql
6365

examples/compose/docker-compose.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ services:
44
portus:
55
image: opensuse/portus:head
66
environment:
7-
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
7+
PORTUS_MACHINE_FQDN_VALUE: ${MACHINE_FQDN}
88

99
# DB. The password for the database should definitely not be here. You are
1010
# probably better off with Docker Swarm secrets.
11-
- PORTUS_PRODUCTION_HOST=db
12-
- PORTUS_PRODUCTION_DATABASE=portus_production
13-
- PORTUS_PRODUCTION_PASSWORD=portus
11+
PORTUS_PRODUCTION_HOST: db
12+
PORTUS_PRODUCTION_DATABASE: portus_production
13+
PORTUS_PRODUCTION_PASSWORD: ${DATABASE_PASSWORD}
1414

1515
# Secrets. It can possibly be handled better with Swarm's secrets.
16-
- PORTUS_SECRET_KEY_BASE=b494a25faa8d22e430e843e220e424e10ac84d2ce0e64231f5b636d21251eb6d267adb042ad5884cbff0f3891bcf911bdf8abb3ce719849ccda9a4889249e5c2
17-
- PORTUS_KEY_PATH=/certificates/portus.key
18-
- PORTUS_PASSWORD=12341234
16+
PORTUS_SECRET_KEY_BASE: ${SECRET_KEY_BASE}
17+
PORTUS_KEY_PATH: /certificates/portus.key
18+
PORTUS_PASSWORD: ${PORTUS_PASSWORD}
1919

2020
# SSL
21-
- PORTUS_PUMA_TLS_KEY=/certificates/portus.key
22-
- PORTUS_PUMA_TLS_CERT=/certificates/portus.crt
21+
PORTUS_PUMA_TLS_KEY: /certificates/portus.key
22+
PORTUS_PUMA_TLS_CERT: /certificates/portus.crt
2323

2424
# NGinx is serving the assets instead of Puma. If you want to change this,
2525
# uncomment this line.
26-
#- RAILS_SERVE_STATIC_FILES=true
26+
#RAILS_SERVE_STATIC_FILES: 'true'
2727
ports:
2828
- 3000:3000
2929
links:
@@ -35,21 +35,21 @@ services:
3535
crono:
3636
image: opensuse/portus:head
3737
environment:
38-
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
38+
PORTUS_MACHINE_FQDN_VALUE: ${MACHINE_FQDN}
3939

4040
# DB. The password for the database should definitely not be here. You are
4141
# probably better off with Docker Swarm secrets.
42-
- PORTUS_PRODUCTION_HOST=db
43-
- PORTUS_PRODUCTION_DATABASE=portus_production
44-
- PORTUS_PRODUCTION_PASSWORD=portus
42+
PORTUS_PRODUCTION_HOST: db
43+
PORTUS_PRODUCTION_DATABASE: portus_production
44+
PORTUS_PRODUCTION_PASSWORD: ${DATABASE_PASSWORD}
4545

4646
# Secrets. It can possibly be handled better with Swarm's secrets.
47-
- PORTUS_SECRET_KEY_BASE=b494a25faa8d22e430e843e220e424e10ac84d2ce0e64231f5b636d21251eb6d267adb042ad5884cbff0f3891bcf911bdf8abb3ce719849ccda9a4889249e5c2
48-
- PORTUS_KEY_PATH=/certificates/portus.key
49-
- PORTUS_PASSWORD=12341234
47+
PORTUS_SECRET_KEY_BASE: ${SECRET_KEY_BASE}
48+
PORTUS_KEY_PATH: /certificates/portus.key
49+
PORTUS_PASSWORD: ${PORTUS_PASSWORD}
5050

5151
# We want to execute crono, not portus
52-
- PORTUS_INIT_COMMAND=bin/crono
52+
PORTUS_INIT_COMMAND: bin/crono
5353
links:
5454
- db
5555
volumes:
@@ -61,7 +61,7 @@ services:
6161
MYSQL_DATABASE: portus_production
6262

6363
# Again, the password shouldn't be handled like this.
64-
MYSQL_ROOT_PASSWORD: portus
64+
MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD}
6565
volumes:
6666
- /var/lib/portus/mariadb:/var/lib/mysql
6767

0 commit comments

Comments
 (0)