forked from openmrs/openmrs-distro-referenceapplication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (20 loc) · 1.04 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
# syntax=docker/dockerfile:1
### Dev Stage
FROM --platform=$BUILDPLATFORM openmrs/openmrs-core:dev as dev
WORKDIR /app
ARG MVN_ARGS_SETTINGS="-s /usr/share/maven/ref/settings-docker.xml -U"
ARG MVN_ARGS="install"
# Copy build files
COPY pom.xml ./
COPY distro ./distro/
# Build the distro
RUN --mount=type=secret,id=m2settings,target=/root/.m2/settings.xml mvn $MVN_ARGS_SETTINGS $MVN_ARGS
### Run Stage
# Replace 'nightly' with the exact version of openmrs-core built for production (if available)
FROM openmrs/openmrs-core:nightly
# Do not copy the war if using the correct openmrs-core image version
COPY --from=dev /app/distro/target/sdk-distro/web/openmrs.war /openmrs/distribution/openmrs_core
COPY --from=dev /app/distro/target/sdk-distro/web/openmrs-distro.properties /openmrs/distribution
COPY --from=dev /app/distro/target/sdk-distro/web/modules /openmrs/distribution/openmrs_modules
COPY --from=dev /app/distro/target/sdk-distro/web/owa /openmrs/distribution/openmrs_owas
COPY --from=dev /app/distro/configuration /openmrs/distribution/openmrs_config