1
- FROM ubuntu:22 .04 as builder
1
+ FROM ubuntu:24 .04 AS builder
2
2
3
3
ENV DEBIAN_FRONTEND=noninteractive
4
4
5
5
6
- RUN apt update && apt install -y tzdata wget git unixodbc-dev libgtk2.0-dev xvfb sqlite3 libsqlite3-dev build-essential curl
6
+ RUN apt update && apt-get upgrade -y && apt install -y tzdata wget git unixodbc-dev libgtk2.0-dev xvfb sqlite3 libsqlite3-dev build-essential curl binutils && apt-get clean && rm -rf /var/lib/apt/lists/*
7
7
8
8
# Download and build OpenSSL 1.1.1w
9
9
WORKDIR /tmp
@@ -15,7 +15,7 @@ RUN wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz \
15
15
&& make test \
16
16
&& make install
17
17
18
- RUN ls -la /usr/local/lib/
18
+ # RUN ls -la /usr/local/lib/
19
19
20
20
# Set the timezone
21
21
RUN echo "UTC" > /etc/timezone
@@ -36,40 +36,114 @@ RUN /work/bootstrap/linux-toolchain.sh /work/bootstrap
36
36
WORKDIR /work/fhirserver
37
37
COPY . /work/fhirserver
38
38
39
- RUN /work/bootstrap/linux-libraries.sh /work/bootstrap
40
- RUN cp /usr/local/lib/*.so* /usr/lib/
41
- RUN /work/fhirserver/build/linux-fhirserver.sh /work/bootstrap
42
- RUN cp exec/pack/*.properties exec/64
39
+ RUN /work/bootstrap/linux-libraries.sh /work/bootstrap && \
40
+ cp /usr/local/lib/*.so* /usr/lib/ && \
41
+ /work/fhirserver/build/linux-fhirserver.sh /work/bootstrap && \
42
+ cp exec/pack/*.properties exec/64
43
+ # RUN cp exec/install/* exec/64
44
+
45
+ RUN mkdir -p /work/fhirserver/exec/install/bin && \
46
+ mkdir -p /work/fhirserver/exec/install/x86_64 && \
47
+ mkdir -p /work/fhirserver/exec/install/content && \
48
+ mkdir -p /work/fhirserver/exec/install/config && \
49
+ # mkdir -p /work/fhirserver/exec/install/config/config && \
50
+ mkdir -p /work/fhirserver/exec/install/default_config && \
51
+ mkdir -p /work/fhirserver/exec/install/web
52
+
53
+ RUN cd /work/fhirserver && \
54
+ cp /work/fhirserver/exec/64/fhirserver /work/fhirserver/exec/install/bin && \
55
+ cp /work/fhirserver/exec/64/FHIRToolkit /work/fhirserver/exec/install/bin && \
56
+ cp /work/fhirserver/exec/64/FHIRConsole /work/fhirserver/exec/install/bin && \
57
+ cp /work/fhirserver/exec/pack/linux/*so* /work/fhirserver/exec/install/x86_64
58
+
59
+ RUN cp /work/fhirserver/exec/pack/linux/start.sh /work/fhirserver/exec/install/bin/start.sh && \
60
+ cp /work/fhirserver/exec/pack/linux/install.sh /work/fhirserver/exec/install && \
61
+ cp /work/fhirserver/exec/pack/linux/get-openssl.sh /work/fhirserver/exec/install && \
62
+ cp /tmp/openssl-1.1.1w/*.so* /work/fhirserver/exec/install/x86_64 && \
63
+ cp /work/fhirserver/exec/pack/*.properties /work/fhirserver/exec/install/content && \
64
+ cp /work/fhirserver/exec/pack/*.dat /work/fhirserver/exec/install/content && \
65
+
66
+ cp /work/fhirserver/exec/pack/fhirserver.cfg /work/fhirserver/exec/install/config && \
67
+ cp /work/fhirserver/exec/pack/web.ini /work/fhirserver/exec/install/config && \
68
+
69
+
70
+ cp /work/fhirserver/exec/pack/web.ini /work/fhirserver/exec/install/default_config && \
71
+ cp /work/fhirserver/exec/pack/fhirserver.cfg /work/fhirserver/exec/install/default_config && \
72
+ cp /work/fhirserver/config/config.ini /work/fhirserver/exec/install/default_config/config.ini && \
73
+ cp /work/fhirserver/config/config.json /work/fhirserver/exec/install/default_config/config.json && \
74
+ # cp /work/fhirserver/config/config.ini /work/fhirserver/exec/install/config/config.ini && \
75
+
76
+ # cp /work/fhirserver/config/config_bare.json /work/fhirserver/exec/install/default_config/config.json && \
77
+ # cp /work/fhirserver/config/config.ini /work/fhirserver/exec/install/config/default_config && \
78
+
79
+ mkdir -p /work/fhirserver/exec/install/web && \
80
+ cp -r /work/fhirserver/server/web/* /work/fhirserver/exec/install/web && \
81
+ cd /work/fhirserver/exec && tar -czvf ./install.tgz ./install/ && ls -la /work/fhirserver/exec
82
+
43
83
44
84
# Set the health check
45
- HEALTHCHECK --interval=1m --timeout=10s --retries=5 \
85
+ HEALTHCHECK --interval=1m --timeout=10s --retries=5 \
46
86
CMD curl -f http://localhost:${PORT}/fhir/metadata || exit 1
47
87
48
88
# Set the environment variables
49
- ENV DISPLAY :99
50
- ENV PORT 80
51
- ENV TERMINOLOGY_CACHE /terminology
89
+ ENV DISPLAY= :99
90
+ ENV PORT= 80
91
+ ENV TERMINOLOGY_CACHE= /terminology
52
92
VOLUME /terminology
53
93
54
94
ENV DEBIAN_FRONTEND=
55
95
56
- RUN printf '#!/bin/bash \n \
57
- set -e \n \
58
- start_xvfb() { \n \
59
- Xvfb :99 -screen 0 1024x768x8 -nolisten tcp & \n \
60
- } \n \
61
- stop_xvfb() { \n \
62
- killall Xvfb || true \n \
63
- } \n \
64
- trap stop_xvfb SIGTERM \n \
65
- rm -f /tmp/.X99-lock \n \
66
- start_xvfb \n \
67
- echo "[web]" > /work/fhirserver/exec/64/web.ini; \n \
68
- echo "http=${PORT}" >> /work/fhirserver/exec/64/web.ini; \n \
69
- /work/fhirserver/exec/64/fhirserver $(eval echo "$@")' > /bin/entrypoint.sh && \
70
- chmod +x /bin/entrypoint.sh
71
-
72
-
73
- ENTRYPOINT ["/bin/entrypoint.sh" ]
74
-
75
- CMD ["-cmd" , "exec" , "-cfg" , "/config/config.ini" , "-local" , "$TERMINOLOGY_CACHE" ]
96
+ # ENTRYPOINT ["/bin/entrypoint.sh"]
97
+
98
+ # CMD ["-cmd", "exec", "-cfg", "/config/config.ini", "-local", "$TERMINOLOGY_CACHE"]
99
+
100
+
101
+
102
+ # Runtime stage
103
+ FROM ubuntu:24.04 AS runtime
104
+
105
+ ENV DEBIAN_FRONTEND=noninteractive
106
+ ENV TZ=UTC
107
+ # Set up environment variables
108
+ # ENV HOME=~/
109
+ ENV DISPLAY=:99
110
+ ENV PORT=80
111
+ ENV TERMINOLOGY_CACHE=/var/cache/txcache
112
+
113
+ # Install runtime dependencies
114
+ RUN apt-get update && apt-get upgrade -y && apt-get install -y wget tzdata xvfb libgtk2.0-0 libsqlite3-dev curl && apt-get clean \
115
+ && rm -rf /var/lib/apt/lists/* \
116
+ && mkdir -p $HOME/fhirserver/config $TERMINOLOGY_CACHE /fhirserver \
117
+ && chmod -R 777 $TERMINOLOGY_CACHE \
118
+ && chmod -R 777 /fhirserver
119
+
120
+ # Copy necessary files from the builder stage
121
+ COPY --from=builder /work/fhirserver/exec/install.tgz /fhirserver/install.tgz
122
+
123
+ # RUN cd /fhirserver \
124
+ # && tar -xzvf install.tgz \
125
+ # && cd ./install \
126
+ # && ./install.sh > install.log 2>&1
127
+
128
+ # Assuming /fhirserver is your working directory
129
+ WORKDIR /fhirserver
130
+
131
+ # Extract the contents of the tar file
132
+ RUN tar -xzvf install.tgz
133
+
134
+ # Change working directory to the extracted folder
135
+ WORKDIR /fhirserver/install
136
+
137
+
138
+ # Run the installation script for a blank, clean install
139
+ RUN chmod a+x ./install.sh && ./install.sh
140
+
141
+ # ###################################################################
142
+
143
+ WORKDIR /root/fhirserver
144
+
145
+ # Define entrypoint and command
146
+ CMD ["bash" , "-c" , "cd ~/fhirserver/ && ./start.sh" ]
147
+
148
+ # Expose the necessary port
149
+ EXPOSE 80
0 commit comments