Skip to content

Commit

Permalink
Restore openmrs user until file permissions are sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Mar 2, 2023
1 parent 6c41b4b commit 8614788
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ CMD ["/openmrs/startup-dev.sh"]
### Production Stage
FROM tomcat:8.5-jdk8-corretto

RUN yum -y update && yum clean all && rm -rf /usr/local/tomcat/webapps/*
RUN yum -y update && yum -y install shadow-utils && yum clean all && rm -rf /usr/local/tomcat/webapps/*

# Setup Tini
ARG TARGETARCH
Expand All @@ -110,18 +110,22 @@ ARG TINI_SHA_ARM64="07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e
RUN if [ "$TARGETARCH" = "arm64" ] ; then TINI_URL="${TINI_URL}-arm64" TINI_SHA=${TINI_SHA_ARM64} ; fi \
&& curl -fsSL -o /usr/bin/tini ${TINI_URL} \
&& echo "${TINI_SHA} /usr/bin/tini" | sha256sum -c \
&& chmod g+rx /usr/bin/tini
&& chmod +rx /usr/bin/tini

RUN useradd -m -d /openmrs/home -u 1001 openmrs

RUN sed -i '/Connector port="8080"/a URIEncoding="UTF-8" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^\`"<>"' \
/usr/local/tomcat/conf/server.xml \
&& chmod -R g+rx /usr/local/tomcat \
&& touch /usr/local/tomcat/bin/setenv.sh && chmod g+w /usr/local/tomcat/bin/setenv.sh \
&& chmod -R g+w /usr/local/tomcat/webapps /usr/local/tomcat/logs /usr/local/tomcat/work /usr/local/tomcat/temp
&& chmod -R 644 /usr/local/tomcat \
&& chmod +x /usr/local/tomcat/bin/*.sh \
&& chmod -R 644 /usr/local/tomcat/webapps /usr/local/tomcat/logs /usr/local/tomcat/work /usr/local/tomcat/temp \
&& chown -R openmrs:openmrs /usr/local/tomcat

RUN mkdir -p /openmrs/data/modules \
&& mkdir -p /openmrs/data/owa \
&& mkdir -p /openmrs/data/configuration \
&& chmod -R g+rw /openmrs
&& chmod -R 644 /openmrs \
&& chown -R openmrs:openmrs /openmrs

# Copy in the start-up scripts
COPY wait-for-it.sh startup-init.sh startup.sh /openmrs/
Expand Down

0 comments on commit 8614788

Please sign in to comment.