forked from HealthIntersections/fhirserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
75 lines (58 loc) · 2.5 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
FROM ubuntu:22.04 as builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y tzdata wget git unixodbc-dev libgtk2.0-dev xvfb sqlite3 libsqlite3-dev build-essential curl
# Download and build OpenSSL 1.1.1w
WORKDIR /tmp
RUN wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz \
&& tar -xf openssl-1.1.1w.tar.gz \
&& cd openssl-1.1.1w \
&& ./config \
&& make \
&& make test \
&& make install
RUN ls -la /usr/local/lib/
# Set the timezone
RUN echo "UTC" > /etc/timezone
RUN cd /tmp && \
wget https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.26-linux-glibc2.12-x86-64bit.tar.gz && \
tar -xzvf mysql-connector-odbc-8.0.26-linux-glibc2.12-x86-64bit.tar.gz && \
cp -r mysql-connector-odbc-8.0.26-linux-glibc2.12-x86-64bit/lib/* /usr/local/lib && \
cp -r mysql-connector-odbc-8.0.26-linux-glibc2.12-x86-64bit/bin/* /usr/local/bin && \
rm -rf mysql-connector-odbc-8.0.26-linux-glibc2.12-x86-64bit && \
rm -rf mysql-connector-odbc-8.0.26-linux-glibc2.12-x86-64bit.tar.gz && \
myodbc-installer -a -d -n "MySQL ODBC 8.0 Driver" -t "Driver=/usr/local/lib/libmyodbc8w.so" && \
myodbc-installer -a -d -n "MySQL ODBC 8.0" -t "Driver=/usr/local/lib/libmyodbc8a.so"
COPY build/linux-toolchain.sh build/linux-libraries.sh /work/bootstrap/
RUN /work/bootstrap/linux-toolchain.sh /work/bootstrap
WORKDIR /work/fhirserver
COPY . /work/fhirserver
RUN /work/bootstrap/linux-libraries.sh /work/bootstrap
RUN cp /usr/local/lib/*.so* /usr/lib/
RUN /work/fhirserver/build/linux-fhirserver.sh /work/bootstrap
RUN cp exec/pack/*.properties exec/64
# Set the health check
HEALTHCHECK --interval=1m --timeout=10s --retries=5 \
CMD curl -f http://localhost:${PORT}/fhir/metadata || exit 1
# Set the environment variables
ENV DISPLAY :99
ENV PORT 80
ENV TERMINOLOGY_CACHE /terminology
VOLUME /terminology
ENV DEBIAN_FRONTEND=
RUN printf '#!/bin/bash \n\
set -e \n\
start_xvfb() { \n\
Xvfb :99 -screen 0 1024x768x8 -nolisten tcp & \n\
} \n\
stop_xvfb() { \n\
killall Xvfb || true \n\
} \n\
trap stop_xvfb SIGTERM \n\
rm -f /tmp/.X99-lock \n\
start_xvfb \n\
echo "[web]" > /work/fhirserver/exec/64/web.ini; \n\
echo "http=${PORT}" >> /work/fhirserver/exec/64/web.ini; \n\
/work/fhirserver/exec/64/fhirserver $(eval echo "$@")' > /bin/entrypoint.sh && \
chmod +x /bin/entrypoint.sh
ENTRYPOINT ["/bin/entrypoint.sh"]
CMD ["-cmd", "exec", "-cfg", "/config/config.ini", "-local", "$TERMINOLOGY_CACHE"]