forked from preet90/PayloadProcessor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
92 lines (69 loc) · 2.61 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
## Builds an OpenEyes DicomProcessor service instance.
ARG MAVEN_TAG=3.6-ibmjava-alpine
ARG BUILD_PROJROOT="/dicomprocessor"
ARG TIMEZONE="Europe/London"
FROM maven:$MAVEN_TAG AS builder
ARG MAVEN_TAG
ARG BUILD_PROJROOT
ARG DEBIAN_FRONTEND=noninteractive
ARG TIMEZONE
## The folder that context files will be copied to
ENV PROJROOT="$BUILD_PROJROOT"
ENV TZ=${TIMEZONE}
#COPY settings.xml /usr/share/maven/conf
# set up folders
COPY . ${PROJROOT}
RUN cd $PROJROOT \
&& mvn package
ENTRYPOINT ["/init.sh"]
FROM maven:$MAVEN_TAG
ARG MAVEN_TAG
ARG BUILD_PROJROOT
ARG DEBIAN_FRONTEND=noninteractive
ARG TIMEZONE
RUN apk add --update tesseract-ocr-dev
## API connection details.
## This is a connection to the openeyes web service
## Defaults to assuming web service will be running on the same docker host on port 80
## But it is recommended to override this
## It is STRONGLY recommended to use docker secrets for the API_PASSWORD
ENV API_HOST="host.docker.internal"
ENV API_PORT=80
ENV API_USER=admin
ENV API_PASSWORD=admin
## Used by some scripts to determine if they are runing in a container
ENV DOCKER_CONTAINER="TRUE"
## Database connection credentials:
## It is STRONGLY recommended to change the password for production environments
## It is STRONGLY recommended to use docker secrets for DATABASE_PASS, rather than env variables
## defaults are db; openeyes; 3306; openeyes; openeyes
ENV DATABASE_HOST="db"
ENV DATABASE_NAME="openeyes"
ENV DATABASE_PASS="openeyes"
ENV DATABASE_PORT="3306"
ENV DATABASE_USER="openeyes"
ENV DEFAULT_SUBSPECIALTY: "Eye Casualty"
ENV DEFAULT_SERVICE: "Eye Casualty Service"
ENV DEFAULT_FIRM_NAME: "Eye Casualty Service"
ENV PROCESSOR_QUEUE_NAME="dicom_queue"
ENV PROCESSOR_SHUTDOWN_AFTER=0
## The folder that context files will be copied to
ENV PROJROOT="$BUILD_PROJROOT"
# This option will retry a database connection for X minutes before failing if a connection has been failed to establish
ENV RETRY_DATABASE_CONNECTION=2
# Number of minutes delay when the engine should synchronize the specified scriptFileLocation with the routine_library table
ENV SYNCHRONIZE_ROUTINE_DELAY=99999
ENV TZ=${TIMEZONE}
ENV WAIT_HOSTS_TIMEOUT=1500
ENV WAIT_SLEEP_INTERVAL=2
# Copy compiled files
COPY --from=builder ${PROJROOT}/target/ ${PROJROOT}
COPY --from=builder ${PROJROOT}/src/main/resources/routineLibrary/ /routineLibrary
RUN mkdir -p /tessdata
RUN curl -o /tessdata/eng.traineddata -LJO https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata
# Add the init script
COPY .docker_build/init.sh /init.sh
COPY .docker_build/wait /wait
RUN chmod a+rx /init.sh /wait
VOLUME ["/tmp"]
ENTRYPOINT ["/init.sh"]