Skip to content
Open
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
162 changes: 57 additions & 105 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
version: '3.6'

# =====================================================================
# OpenELIS Global 2 — Dokploy-ready docker-compose
# Deploy in Dokploy as Compose Type: "Docker Compose" (NOT Stack/Swarm)
#
# Key differences vs the upstream file (why the original errored):
# - No host port bindings on 80/443 (Traefik owns them in Dokploy)
# - No container_name (breaks Dokploy logging/monitoring)
# - No static ipv4_address / custom subnet (collides on a busy host)
# - Ports -> expose (internal only; Traefik reaches proxy over its network)
# - Persistent data moved to ../files (survives redeploys)
# - Internal nginx proxy runs HTTP-only; Traefik terminates public TLS
# =====================================================================

x-logging:
&local-logging
driver: "local"
options:
max-size: "20m"
max-file: "50"

x-loki-logging:
&loki-logging
driver: "loki"
options:
max-size: "20m"
max-file: "50"
loki-url: "[% loki_url %]"
loki-external-labels: "container_name={{.Name}},hostname=[% host_name %]"
loki-pipeline-stages: |
- multiline:
firstline: '^\d{4}-\d{2}-\d{2}[T ]?\d{2}:\d{2}:\d{2}.\d{3}'
- labeldrop:
- compose_project
- compose_service
- filename
- source
- stream
- swarm_service
- swarm_stack
services:
certs:
container_name: oe-certs
image: itechuw/certgen:main
platform: linux/amd64
restart: "no"
Expand All @@ -38,178 +31,137 @@ services:
networks:
- openelis-network
volumes:
- key_trust-store-volume:/etc/openelis-global
- keys-vol:/etc/ssl/private/
- certs-vol:/etc/ssl/certs/
- key_trust-store-volume:/etc/openelis-global
- keys-vol:/etc/ssl/private/
- certs-vol:/etc/ssl/certs/

db.openelis.org:
container_name: openelisglobal-database
image: itechuw/openelis-global-2-database:develop
platform: linux/amd64
ports:
- "15432:5432"
expose:
- "5432"
restart: always
env_file:
- ./configs/database/database.env
environment:
- DB_PASSWORD=${OE_DB_PASSWORD}
- DB_SUPERUSER_PASSWORD=${ADMIN_PASSWORD}
- DB_SUPERUSER_PASSWORD=${ADMIN_PASSWORD}
volumes:
# preserves the database between containers
- ./configs/database/data:/var/lib/postgresql/data

logging: *local-logging
- ../files/database/data:/var/lib/postgresql/data
logging: *local-logging
networks:
- openelis-network
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "clinlims", "-U", "clinlims" ]
timeout: 45s
interval: 10s
retries: 10
retries: 10

oe.openelis.org:
container_name: openelisglobal-webapp
image: itechuw/openelis-global-2:develop
platform: linux/amd64
image: itechuw/openelis-global-2:develop
platform: linux/amd64
depends_on:
- db.openelis.org
- certs
ports:
- "8080:8080"
- "8443:8443"
expose:
- "8080"
- "8443"
restart: always
networks:
openelis-network:
ipv4_address: 172.20.1.121
logging: *local-logging
- openelis-network
logging: *local-logging
environment:
- DEFAULT_PW=adminADMIN!
- DEFAULT_PW=adminADMIN!
- TZ=America/New_York
# Config variables loaded through Tomacat server.xml
- CATALINA_OPTS= -Ddatasource.url=jdbc:postgresql://db.openelis.org:5432/clinlims -Ddatasource.username=clinlims -Ddatasource.password=${OE_DB_PASSWORD} -Doe.ssl.truststorepath=${SSL_TRUSTSTORE_PATH} -Doe.ssl.truststorepassword=${SSL_TRUSTSTORE_PASSWORD} -Doe.ssl.keystorepath=${SSL_KEYSTORE_PATH} -Doe.ssl.keystorepassword=${SSL_KEYSTORE_PASSWORD}
# Env variables passed to the common properties file
- SSL_KEYSTORE_PATH
- SSL_KEYSTORE_PASSWORD
- SSL_TRUSTSTORE_PATH
- SSL_TRUSTSTORE_PASSWORD
volumes:
- key_trust-store-volume:/etc/openelis-global
- lucene_index-vol:/var/lib/lucene_index
- key_trust-store-volume:/etc/openelis-global
- lucene_index-vol:/var/lib/lucene_index
- ./configs/plugins/:/var/lib/openelis-global/plugins
- ./configs/logs/oeLogs:/var/lib/openelis-global/logs
- ./configs/logs/tomcatLogs/:/usr/local/tomcat/logs
- ../files/logs/oeLogs:/var/lib/openelis-global/logs
- ../files/logs/tomcatLogs/:/usr/local/tomcat/logs
- ./configs/properties:/var/lib/openelis-global/properties
- ./configs/analyzer/analyzer-test-map.csv:/var/lib/openelis-global/analyzer/analyzer-test-map.csv
- ./configs/odoo/odoo-test-product-mapping.csv:/var/lib/openelis-global/odoo/odoo-test-product-mapping.csv
- ./configs/programs/:/var/lib/openelis-global/programs
- ./configs/configuration:/var/lib/openelis-global/configuration
- ./configs/menu/menu_config.json:/var/lib/openelis-global/menu/menu_config.json
- ./configs/branding:/var/lib/openelis-global/branding
- ./configs/nce-attachments:/var/lib/openelis-global/nce-attachments # NCE file attachments
- ../files/nce-attachments:/var/lib/openelis-global/nce-attachments
secrets:
- source: common.properties

fhir.openelis.org:
container_name: external-fhir-api
image: itechuw/openelis-global-2-fhir:develop
platform: linux/amd64
ports:
- "8081:8080"
- "8444:8443"
expose:
- "8080"
- "8443"
depends_on:
- db.openelis.org
- certs
- certs
networks:
- openelis-network
restart: always
environment:
TZ: America/New_York

JAVA_OPTS: "-Djavax.net.ssl.trustStore=${SSL_TRUSTSTORE_PATH}
-Djavax.net.ssl.trustStorePassword=${SSL_TRUSTSTORE_PASSWORD}
-Djavax.net.ssl.trustStoreType=pkcs12
-Djavax.net.ssl.keyStore=${SSL_KEYSTORE_PATH}
-Djavax.net.ssl.keyStorePassword=${SSL_KEYSTORE_PASSWORD}
-Djavax.net.ssl.keyStoreType=pkcs12"
# Config variables loaded through Tomacat server.xml
CATALINA_OPTS: "-Dhapi.ssl.truststorepath=${SSL_TRUSTSTORE_PATH} -Dhapi.ssl.truststorepassword=${SSL_TRUSTSTORE_PASSWORD} -Dhapi.ssl.keystorepath=${SSL_KEYSTORE_PATH} -Dhapi.ssl.keystorepassword=${SSL_KEYSTORE_PASSWORD}"
# Config variables loaded through Hapi application.yml
FHIR_DATASOURCE_URL : "jdbc:postgresql://db.openelis.org:5432/clinlims?currentSchema=clinlims"
CATALINA_OPTS: "-Dhapi.ssl.truststorepath=${SSL_TRUSTSTORE_PATH} -Dhapi.ssl.truststorepassword=${SSL_TRUSTSTORE_PASSWORD} -Dhapi.ssl.keystorepath=${SSL_KEYSTORE_PATH} -Dhapi.ssl.keystorepassword=${SSL_KEYSTORE_PASSWORD}"
FHIR_DATASOURCE_URL: "jdbc:postgresql://db.openelis.org:5432/clinlims?currentSchema=clinlims"
FHIR_DATASOURCE_USERNAME: "clinlims"
FHIR_DATASOURCE_PASSWORD: ${OE_DB_PASSWORD}
FHIR_SERVER_ADRESS: "http://fhir.openelis.org:8080/fhir/"

logging: *local-logging
logging: *local-logging
volumes:
- key_trust-store-volume:/etc/openelis-global
- key_trust-store-volume:/etc/openelis-global

frontend.openelis.org:
image: itechuw/openelis-global-2-frontend:develop
container_name: openelisglobal-front-end
platform: linux/amd64
networks:
- openelis-network
environment:
- CHOKIDAR_USEPOLLING=true
logging: *local-logging
logging: *local-logging
tty: true

proxy:
image: itechuw/openelis-global-2-proxy:develop
container_name: openelisglobal-proxy
platform: linux/amd64
ports:
- 80:80
- 443:443
environment:
- OE_NGINX_CERT=${OE_NGINX_CERT:-apache-selfsigned.crt}
- OE_NGINX_KEY=${OE_NGINX_KEY:-apache-selfsigned.key}
expose:
- "80"
command:
- /bin/sh
- -c
- "envsubst '$$OE_NGINX_CERT $$OE_NGINX_KEY' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"
- "cp /etc/nginx/nginx.conf.template /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Render an HTTP nginx config before starting proxy

This command now copies the existing nginx template verbatim even though the compose file exposes only port 80 and removed the certificate environment/volume wiring. The mounted configs/nginx/nginx.conf still redirects port 80 to HTTPS and references ssl_certificate /etc/nginx/certs/${OE_NGINX_CERT}, so a Dokploy route to the proxy either loops back to HTTPS instead of reaching the app or the proxy fails to start because the cert paths/placeholders are not available. Update the template/command to produce a real HTTP-only config, or keep the TLS rendering and cert mounts.

Useful? React with 👍 / 👎.

volumes:
- ${OE_CERTS_PATH:-certs-vol}:/etc/nginx/certs/
- ${OE_KEYS_PATH:-keys-vol}:/etc/nginx/keys/
- ./configs/nginx/nginx.conf:/etc/nginx/nginx.conf.template:ro
# - /KEYSTORE_PASSWORD:/etc/nginx/private/key_pass
# - /etc/openelis-global/nginx.cert.pem:/etc/nginx/certs/cert.crt
# - /etc/openelis-global/nginx.key.pem:/etc/nginx/certs/cert.key
restart: unless-stopped
networks:
- openelis-network
logging: *local-logging
logging: *local-logging
depends_on:
- certs

autoheal:
container_name: autoheal-oe
image: willfarrell/autoheal:1.2.0
tty: true
restart: always
networks:
- openelis-network
environment:
AUTOHEAL_CONTAINER_LABEL: all
TZ: America/New_York
logging: *local-logging
volumes:
- /var/run/docker.sock:/var/run/docker.sock

secrets:
- frontend.openelis.org
- oe.openelis.org

secrets:
common.properties:
file: ./configs/properties/common.properties
file: ./configs/properties/common.properties

networks:
openelis-network:
name: openelis-network
driver: bridge
ipam:
config:
- subnet: 172.20.1.0/24


volumes:
db-data:
key_trust-store-volume:
certs-vol:
keys-vol:
Expand Down