init
This commit is contained in:
86
platform/app/.recipes/Nginx-Dcm4chee/config/nginx.conf
Normal file
86
platform/app/.recipes/Nginx-Dcm4chee/config/nginx.conf
Normal file
@@ -0,0 +1,86 @@
|
||||
worker_processes auto;
|
||||
error_log /var/logs/nginx/error.log debug;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
use epoll;
|
||||
multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/logs/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
|
||||
client_max_body_size 0;
|
||||
|
||||
|
||||
# Handle /pacs requests and rewrite them to the correct dcm4chee-arc UI path
|
||||
# This allows accessing the dcm4chee-arc UI through the /pacs URL
|
||||
location /pacs {
|
||||
rewrite ^/pacs(.*)$ /dcm4chee-arc/ui2$1 break;
|
||||
proxy_pass http://arc:8080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
expires 0;
|
||||
add_header Cache-Control private;
|
||||
}
|
||||
|
||||
# Proxy all dcm4chee-arc requests
|
||||
# This block handles all API requests and general dcm4chee-arc paths
|
||||
location /dcm4chee-arc/ {
|
||||
proxy_pass http://arc:8080/dcm4chee-arc/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
}
|
||||
|
||||
|
||||
location /sw.js {
|
||||
add_header Cache-Control "no-cache";
|
||||
proxy_cache_bypass $http_pragma;
|
||||
proxy_cache_revalidate on;
|
||||
expires off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /var/www/html;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||
add_header Cross-Origin-Opener-Policy 'same-origin' always;
|
||||
add_header Cross-Origin-Embedder-Policy 'require-corp' always;
|
||||
}
|
||||
}
|
||||
}
|
||||
4
platform/app/.recipes/Nginx-Dcm4chee/docker-compose.env
Normal file
4
platform/app/.recipes/Nginx-Dcm4chee/docker-compose.env
Normal file
@@ -0,0 +1,4 @@
|
||||
STORAGE_DIR=/storage/fs1
|
||||
POSTGRES_DB=pacsdb
|
||||
POSTGRES_USER=pacs
|
||||
POSTGRES_PASSWORD=pacs
|
||||
73
platform/app/.recipes/Nginx-Dcm4chee/docker-compose.yml
Normal file
73
platform/app/.recipes/Nginx-Dcm4chee/docker-compose.yml
Normal file
@@ -0,0 +1,73 @@
|
||||
services:
|
||||
ldap:
|
||||
image: dcm4che/slapd-dcm4chee:2.6.3-29.0
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
ports:
|
||||
- "389:389"
|
||||
env_file: docker-compose.env
|
||||
volumes:
|
||||
- ~/dcm4chee-arc/ldap:/var/lib/ldap
|
||||
- ~/dcm4chee-arc/slapd.d:/etc/ldap/slapd.d
|
||||
db:
|
||||
image: dcm4che/postgres-dcm4chee:14.5-29
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
ports:
|
||||
- "5432:5432"
|
||||
env_file: docker-compose.env
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- ~/dcm4chee-arc/db:/var/lib/postgresql/data
|
||||
arc:
|
||||
image: dcm4che/dcm4chee-arc-psql:5.29.0
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "8443:8443"
|
||||
- "9990:9990"
|
||||
- "9993:9993"
|
||||
- "11112:11112"
|
||||
- "2762:2762"
|
||||
- "2575:2575"
|
||||
- "12575:12575"
|
||||
env_file: docker-compose.env
|
||||
environment:
|
||||
WILDFLY_CHOWN: /opt/wildfly/standalone /storage
|
||||
WILDFLY_WAIT_FOR: ldap:389 db:5432
|
||||
depends_on:
|
||||
- ldap
|
||||
- db
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- ~/dcm4chee-arc/wildfly:/opt/wildfly/standalone
|
||||
- ~/dcm4chee-arc/storage:/storage
|
||||
ohif_viewer:
|
||||
build:
|
||||
# Project root
|
||||
context: ./../../../../
|
||||
# Relative to context
|
||||
dockerfile: ./platform/app/.recipes/Nginx-Dcm4chee/dockerfile
|
||||
image: webapp:latest
|
||||
container_name: ohif_dcm4chee
|
||||
volumes:
|
||||
# Nginx config
|
||||
- ./config/nginx.conf:/etc/nginx/nginx.conf
|
||||
# Logs
|
||||
- ./logs/nginx:/var/logs/nginx
|
||||
# Let's Encrypt
|
||||
# - letsencrypt_certificates:/etc/letsencrypt
|
||||
# - letsencrypt_challenges:/var/www/letsencrypt
|
||||
ports:
|
||||
- '443:443' # SSL
|
||||
- '80:80' # Web
|
||||
restart: on-failure
|
||||
43
platform/app/.recipes/Nginx-Dcm4chee/dockerfile
Normal file
43
platform/app/.recipes/Nginx-Dcm4chee/dockerfile
Normal file
@@ -0,0 +1,43 @@
|
||||
# Stage 1: Build the application
|
||||
FROM node:18.16.1-slim as builder
|
||||
|
||||
# Setup the working directory
|
||||
RUN mkdir /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install dependencies
|
||||
# apt-get update is combined with apt-get install to avoid using outdated packages
|
||||
RUN apt-get update && apt-get install -y build-essential python3
|
||||
|
||||
# Copy package.json and other dependency-related files first
|
||||
# Assuming your package.json and yarn.lock or similar are located in the project root
|
||||
|
||||
COPY ./ /usr/src/app/
|
||||
|
||||
# Install node dependencies
|
||||
RUN yarn config set workspaces-experimental true
|
||||
RUN yarn install
|
||||
|
||||
# Copy the rest of the application code
|
||||
|
||||
# set QUICK_BUILD to true to make the build faster for dev
|
||||
ENV APP_CONFIG=config/docker-nginx-dcm4chee.js
|
||||
|
||||
# Build the application
|
||||
RUN yarn run build
|
||||
|
||||
# # Stage 2: Bundle the built application into a Docker container which runs NGINX using Alpine Linux
|
||||
FROM nginx:alpine
|
||||
|
||||
# # Create directories for logs and html content if they don't already exist
|
||||
RUN mkdir -p /var/log/nginx /var/www/html
|
||||
|
||||
|
||||
# # Copy build output to serve static files
|
||||
COPY --from=builder /usr/src/app/platform/app/dist /var/www/html
|
||||
|
||||
# # Expose HTTP and HTTPS ports
|
||||
EXPOSE 80 443
|
||||
|
||||
# # Start NGINX
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
0
platform/app/.recipes/Nginx-Dcm4chee/etc/localtime
Normal file
0
platform/app/.recipes/Nginx-Dcm4chee/etc/localtime
Normal file
1
platform/app/.recipes/Nginx-Dcm4chee/etc/timezone
Normal file
1
platform/app/.recipes/Nginx-Dcm4chee/etc/timezone
Normal file
@@ -0,0 +1 @@
|
||||
America/New_York
|
||||
Reference in New Issue
Block a user