Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use environment-based Docker image in Docker-compose #105

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

HOSTNAME_TAG=dev
SPA_PATH=/openmrs/spa
API_URL=/openmrs
SPA_CONFIG_URLS=/openmrs/spa/custom-config.json
OMRS_CONFIG_MODULE_WEB_ADMIN="true"
OMRS_CONFIG_AUTO_UPDATE_DATABASE="true"
OMRS_CONFIG_CREATE_TABLES="true"
OMRS_CONFIG_CONNECTION_SERVER=db
9 changes: 9 additions & 0 deletions .env.qa
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

HOSTNAME_TAG=qa
SPA_PATH=/openmrs/spa
API_URL=/openmrs
SPA_CONFIG_URLS=/openmrs/spa/custom-config.json
OMRS_CONFIG_MODULE_WEB_ADMIN="true"
OMRS_CONFIG_AUTO_UPDATE_DATABASE="true"
OMRS_CONFIG_CREATE_TABLES="true"
OMRS_CONFIG_CONNECTION_SERVER=db
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export OMRS_CONFIG_CONNECTION_DATABASE=$(vault kv get -mount=secret -field=omrs-config-connection-database-key omrs-config-connection-database)
export OMRS_CONFIG_CONNECTION_USERNAME=$(vault kv get -mount=secret -field=omrs-config-connection-username-key omrs-config-connection-username)
export OMRS_CONFIG_CONNECTION_PASSWORD=$(vault kv get -mount=secret -field=omrs-config-connection-password-key omrs-config-connection-password)
export OMRS_MYSQL_DATABASE=$(vault kv get -mount=secret -field=OMRS_mysql-database-key OMRS_mysql-database)
export OMRS_MYSQL_USER=$(vault kv get -mount=secret -field=OMRS_mysql-user-key OMRS_mysql-user)
export OMRS_MYSQL_PASSWORD=$(vault kv get -mount=secret -field=OMRS_mysql-password-key OMRS_mysql-password)
export OMRS_MYSQL_ROOT_PASSWORD=$(vault kv get -mount=secret -field=OMRS_mysql-root-password-key mysql-root-password)
16 changes: 8 additions & 8 deletions distro/e2e_test_support_files/docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ services:
depends_on:
- db
environment:
OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
OMRS_CONFIG_CREATE_TABLES: "true"
OMRS_CONFIG_CONNECTION_SERVER: db
OMRS_CONFIG_CONNECTION_DATABASE: openmrs
OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
OMRS_CONFIG_MODULE_WEB_ADMIN: ${OMRS_CONFIG_MODULE_WEB_ADMIN:-true}
OMRS_CONFIG_AUTO_UPDATE_DATABASE: ${OMRS_CONFIG_AUTO_UPDATE_DATABASE:-true}
OMRS_CONFIG_CREATE_TABLES: ${OMRS_CONFIG_CREATE_TABLES:-true}
OMRS_CONFIG_CONNECTION_SERVER: ${OMRS_CONFIG_CONNECTION_SERVER:-db}
OMRS_CONFIG_CONNECTION_DATABASE: ${OMRS_CONFIG_CONNECTION_DATABASE:-openmrs}
OMRS_CONFIG_CONNECTION_USERNAME: ${OMRS_CONFIG_CONNECTION_USERNAME:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OMRS_CONFIG_CONNECTION_PASSWORD:-openmrs}
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs" ]
timeout: 5s
Expand All @@ -55,5 +55,5 @@ services:
MYSQL_DATABASE: openmrs
MYSQL_USER: ${OPENMRS_DB_USER:-openmrs}
MYSQL_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${OMRS_MYSQL_ROOT_PASSWORD:-openmrs}

20 changes: 10 additions & 10 deletions docker-compose.cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ services:
backend:
image: msfocg/openmrs3-backend:dev
environment:
OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
OMRS_CONFIG_CREATE_TABLES: "true"
OMRS_CONFIG_CONNECTION_SERVER: db
OMRS_CONFIG_CONNECTION_DATABASE: openmrs
OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
OMRS_CONFIG_MODULE_WEB_ADMIN: ${OMRS_CONFIG_MODULE_WEB_ADMIN:-true}
OMRS_CONFIG_AUTO_UPDATE_DATABASE: ${OMRS_CONFIG_AUTO_UPDATE_DATABASE:-true}
OMRS_CONFIG_CREATE_TABLES: ${OMRS_CONFIG_CREATE_TABLES:-true}
OMRS_CONFIG_CONNECTION_SERVER: ${OMRS_CONFIG_CONNECTION_SERVER:-db}
OMRS_CONFIG_CONNECTION_DATABASE: ${OMRS_CONFIG_CONNECTION_DATABASE:-openmrs}
OMRS_CONFIG_CONNECTION_USERNAME: ${OMRS_CONFIG_CONNECTION_USERNAME:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OMRS_CONFIG_CONNECTION_PASSWORD:-openmrs}
networks:
- backend
depends_on:
Expand All @@ -51,9 +51,9 @@ services:
command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci"
environment:
MYSQL_DATABASE: openmrs
MYSQL_USER: ${OMRS_DB_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
MYSQL_USER: ${OMRS_MYSQL_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_MYSQL_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${OMRS_MYSQL_ROOT_PASSWORD:-openmrs}
networks:
- backend
# deploy:
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ services:
delay: 10s
order: stop-first
environment:
OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
OMRS_CONFIG_CREATE_TABLES: "true"
OMRS_CONFIG_CONNECTION_SERVER: db
OMRS_CONFIG_CONNECTION_DATABASE: openmrs
OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
OMRS_CONFIG_MODULE_WEB_ADMIN: ${OMRS_CONFIG_MODULE_WEB_ADMIN:-true}
OMRS_CONFIG_AUTO_UPDATE_DATABASE: ${OMRS_CONFIG_AUTO_UPDATE_DATABASE:-true}
OMRS_CONFIG_CREATE_TABLES: ${OMRS_CONFIG_CREATE_TABLES:-true}
OMRS_CONFIG_CONNECTION_SERVER: ${OMRS_CONFIG_CONNECTION_SERVER:-db}
OMRS_CONFIG_CONNECTION_DATABASE: ${OMRS_CONFIG_CONNECTION_DATABASE:-openmrs}
OMRS_CONFIG_CONNECTION_USERNAME: ${OMRS_CONFIG_CONNECTION_USERNAME:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OMRS_CONFIG_CONNECTION_PASSWORD:-openmrs}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"]
timeout: 5s
Expand All @@ -71,9 +71,9 @@ services:
order: stop-first
environment:
MYSQL_DATABASE: openmrs
MYSQL_USER: ${OMRS_DB_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
MYSQL_USER: ${OMRS_MYSQL_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_MYSQL_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${OMRS_MYSQL_ROOT_PASSWORD:-openmrs}
ports:
- 3307:3306
volumes:
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ services:
depends_on:
- db
environment:
OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
OMRS_CONFIG_CREATE_TABLES: "true"
OMRS_CONFIG_CONNECTION_SERVER: db
OMRS_CONFIG_CONNECTION_DATABASE: openmrs
OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
OMRS_CONFIG_MODULE_WEB_ADMIN: ${OMRS_CONFIG_MODULE_WEB_ADMIN:-true}
OMRS_CONFIG_AUTO_UPDATE_DATABASE: ${OMRS_CONFIG_AUTO_UPDATE_DATABASE:-true}
OMRS_CONFIG_CREATE_TABLES: ${OMRS_CONFIG_CREATE_TABLES:-true}
OMRS_CONFIG_CONNECTION_SERVER: ${OMRS_CONFIG_CONNECTION_SERVER:-db}
OMRS_CONFIG_CONNECTION_DATABASE: ${OMRS_CONFIG_CONNECTION_DATABASE:-openmrs}
OMRS_CONFIG_CONNECTION_USERNAME: ${OMRS_CONFIG_CONNECTION_USERNAME:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OMRS_CONFIG_CONNECTION_PASSWORD:-openmrs}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"]
timeout: 5s
Expand All @@ -65,10 +65,10 @@ services:
delay: 10s
order: stop-first
environment:
MYSQL_DATABASE: openmrs
MYSQL_USER: ${OMRS_DB_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
MYSQL_DATABASE: ${OMRS_MYSQL_DATABASE:-openmrs}
MYSQL_USER: ${OMRS_MYSQL_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_MYSQL_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${OMRS_MYSQL_ROOT_PASSWORD:-openmrs}
ports:
- 3307:3306
volumes:
Expand Down
Loading