Skip to content

Commit

Permalink
TRUNK-6083 Updating O3 to new core image (#657)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian <ian_bacher@brown.edu>
  • Loading branch information
rkorytkowski and ibacher committed Nov 29, 2022
1 parent 096ec3d commit 7398ff9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
22 changes: 15 additions & 7 deletions Dockerfile
@@ -1,8 +1,8 @@
# syntax=docker/dockerfile:1

### Dev Stage
FROM --platform=$BUILDPLATFORM openmrs/openmrs-core:dev as dev
WORKDIR /app
FROM openmrs/openmrs-core:dev as dev
WORKDIR /openmrs_distro

ARG MVN_ARGS_SETTINGS="-s /usr/share/maven/ref/settings-docker.xml -U"
ARG MVN_ARGS="install"
Expand All @@ -14,15 +14,23 @@ COPY distro ./distro/
# Build the distro
RUN --mount=type=secret,id=m2settings,target=/root/.m2/settings.xml mvn $MVN_ARGS_SETTINGS $MVN_ARGS

RUN cp /openmrs_distro/distro/target/sdk-distro/web/openmrs.war /openmrs/distribution/openmrs_core/

RUN cp /openmrs_distro/distro/target/sdk-distro/web/openmrs-distro.properties /openmrs/distribution/
RUN cp -R /openmrs_distro/distro/target/sdk-distro/web/modules /openmrs/distribution/openmrs_modules
RUN cp -R /openmrs_distro/distro/target/sdk-distro/web/owa /openmrs/distribution/openmrs_owas

# Clean up after copying needed artifacts
RUN mvn clean $MVN_ARGS_SETTINGS

### 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 /openmrs/distribution/openmrs_core/openmrs.war /openmrs/distribution/openmrs_core/

COPY --from=dev /app/distro/target/sdk-distro/web/openmrs-distro.properties /openmrs/distribution
COPY --from=dev /openmrs/distribution/openmrs-distro.properties /openmrs/distribution/
COPY --from=dev /openmrs/distribution/openmrs_modules /openmrs/distribution/openmrs_modules
COPY --from=dev /openmrs/distribution/openmrs_owas /openmrs/distribution/openmrs_owas

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
11 changes: 9 additions & 2 deletions docker-compose.yml
Expand Up @@ -18,6 +18,8 @@ services:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
timeout: 5s
depends_on:
- backend

backend:
image: openmrs/openmrs-reference-application-3-backend:${TAG:-nightly}
Expand All @@ -41,10 +43,15 @@ services:
db:
image: mariadb:10.8.2
command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci"
healthcheck:
test: "mysql --user=${OMRS_DB_USER:-openmrs} --password=${OMRS_DB_PASSWORD:-openmrs} --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
environment:
MYSQL_DATABASE: openmrs
MYSQL_USER: ${OPENMRS_DB_USER:-openmrs}
MYSQL_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
MYSQL_USER: ${OMRS_DB_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
volumes:
- db-data:/var/lib/mysql
Expand Down

0 comments on commit 7398ff9

Please sign in to comment.