Skip to content

Commit eba51bd

Browse files
authored
Merge pull request #621 from fredericve/master
allow setting DB_ROOT_USER and DB_ROOT_PASS env variables for docker
2 parents 46c9958 + dcfe6d4 commit eba51bd

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM node:16-alpine as webapp
2-
ENV BUILD 20220211-001
1+
FROM node:16-alpine AS webapp
2+
ENV BUILD=20220211-001
33
RUN apk add git && git clone https://github.com/sipcapture/homer-ui /app
44
WORKDIR /app
55
RUN npm install && npm install -g @angular/cli && npm run build
66

7-
FROM golang:alpine as webapi
8-
ENV BUILD 20220211-001
7+
FROM golang:alpine AS webapi
8+
ENV BUILD=20220211-001
99
RUN apk --update add git make
1010
COPY . /homer-app
1111
WORKDIR /homer-app

docker/docker-entrypoint.d/9

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@ DB_HOST=${DB_HOST:-db}
44
DB_PORT=${DB_PORT:-5432}
55
DB_USER=${DB_USER:-root}
66
DB_PASS=${DB_PASS:-homerSeven}
7+
DB_ROOT_USER=${DB_ROOT_USER:-$DB_USER}
8+
DB_ROOT_PASS=${DB_ROOT_PASS:-$DB_PASS}
79

810
if [ -f /usr/local/homer/etc/webapp_config.json ]; then
911

1012
###Create user
11-
#/homer-app -create-homer-user -database-root-user=$DB_USER -database-host=$DB_HOST -database-root-password=$DB_PASS
13+
#/homer-app -create-homer-user -database-root-user=$DB_ROOT_USER -database-host=$DB_HOST -database-root-password=$DB_ROOT_PASS
1214
###Show user
13-
#/homer-app -show-db-user -database-root-user=$DB_USER -database-host=$DB_HOST -database-root-password=$DB_PASS
15+
#/homer-app -show-db-user -database-root-user=$DB_ROOT_USER -database-host=$DB_HOST -database-root-password=$DB_ROOT_PASS
1416
###Create Role
15-
#/homer-app -create-homer-role -database-root-user=$DB_USER -database-host=localhost -database-root-password=postgres -database-homer-data=homer_data -database-homer-config=homer_config
17+
#/homer-app -create-homer-role -database-root-user=$DB_ROOT_USER -database-host=localhost -database-root-password=$DB_ROOT_PASS -database-homer-data=homer_data -database-homer-config=homer_config
1618

1719
###Create DB
18-
/homer-app -create-config-db -database-root-user=$DB_USER -database-host=$DB_HOST -database-port=$DB_PORT -database-root-password=$DB_PASS -database-homer-user=$DB_USER
19-
/homer-app -create-data-db -database-root-user=$DB_USER -database-host=$DB_HOST -database-port=$DB_PORT -database-root-password=$DB_PASS -database-homer-user=$DB_USER
20+
/homer-app -create-config-db -database-root-user=$DB_ROOT_USER -database-host=$DB_HOST -database-port=$DB_PORT -database-root-password=$DB_ROOT_PASS -database-homer-user=$DB_USER
21+
/homer-app -create-data-db -database-root-user=$DB_ROOT_USER -database-host=$DB_HOST -database-port=$DB_PORT -database-root-password=$DB_ROOT_PASS -database-homer-user=$DB_USER
2022

2123
#Save it or edit the webapp_config.json manualy
2224
#/homer-app -save-homer-db-config-settings -database-host=localhost -database-homer-config=homer_config -database-homer-user=homer_user -database-homer-password=homer_password

0 commit comments

Comments
 (0)