Skip to content

Commit

Permalink
feat: schema image uses docker-entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-foucault committed Jun 10, 2020
1 parent 28bb4d2 commit b530194
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 92 deletions.
File renamed without changes.
39 changes: 0 additions & 39 deletions .bin/fix-permissions

This file was deleted.

42 changes: 0 additions & 42 deletions app/.s2i/bin/assemble

This file was deleted.

5 changes: 0 additions & 5 deletions app/.s2i/bin/run

This file was deleted.

3 changes: 0 additions & 3 deletions app/.s2i/bin/save-artifacts

This file was deleted.

2 changes: 2 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ RUN yarn install --frozen-lockfile --production=false && \
yarn install --frozen-lockfile --production=true && \
yarn cache clean

COPY .bin/docker-entrypoint.sh ${CIIP_HOME}

# Make everything in the home group-writable, to accomodate anyuid (in OpenShift)
# /etc/passwd needs to be group-writable too -_-
# Needs to be done as root to chown
Expand Down
22 changes: 19 additions & 3 deletions schema/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Docker build should be run from parent directory
FROM perl:5.26

ENV HOME=/usr/src/cas-ciip-portal-schema
ENV USER_ID=1001
ENV CIIP_HOME=/root
ENV HOME=/root
COPY schema/ ${HOME}/
WORKDIR ${HOME}

Expand All @@ -10,11 +12,25 @@ RUN apt-get update && \
apt-get clean

RUN cpanm --notest -l extlib --installdeps .
COPY .bin/fix-permissions /usr/bin/fix-permissions
RUN chmod g=u /etc/passwd && fix-permissions ./

# CPAN can install scripts. They should be available from mod_perl too.
ENV PATH="$PATH:$HOME/extlib/bin"
# And we have to set Perl include path too because mod_perl's PerlSwitches
# does not apply to them.
ENV PERL5LIB=${HOME}/extlib/lib/perl5

COPY .bin/docker-entrypoint.sh ${CIIP_HOME}

# Make everything in the home group-writable, to accomodate anyuid (in OpenShift)
# /etc/passwd needs to be group-writable too -_-
# Needs to be done as root to chown
RUN useradd -ms /bin/bash -d ${CIIP_HOME} --uid ${USER_ID} ciip
RUN chown -R ciip:0 ${CIIP_HOME} && \
chmod g=u /etc/passwd && \
chmod -R g+rwX ${CIIP_HOME}

EXPOSE 3000
USER ${USER_ID}
WORKDIR ${CIIP_HOME}

ENTRYPOINT ["./docker-entrypoint.sh"]

0 comments on commit b530194

Please sign in to comment.