fix home dir permissions

This commit is contained in:
Blair Vanderlugt 2021-03-15 07:10:08 -07:00
parent bd4e5b0a40
commit c0dff41b3c

View File

@ -104,26 +104,17 @@ FROM python:3.8.6-slim-buster as runtime-image
COPY --from=compile-image /usr/local/bin/ /usr/local/bin/ COPY --from=compile-image /usr/local/bin/ /usr/local/bin/
COPY --from=compile-image /usr/local/etc/cic/ /usr/local/etc/cic/ COPY --from=compile-image /usr/local/etc/cic/ /usr/local/etc/cic/
RUN mkdir -p /tmp/cic/config
RUN chmod a+rw /tmp/cic/config
ENV HOME /home/grassroots ENV HOME /home/grassroots
RUN useradd --create-home grassroots RUN useradd --create-home grassroots
WORKDIR $HOME WORKDIR $HOME
# COPY python dependencies to user dir # COPY python dependencies to user dir
COPY --from=compile-image /root/.local .local COPY --from=compile-image /root/.local .local
RUN chown -R grassroots:grassroots $HOME/.local/
ENV PATH=$HOME/.local/bin:$PATH ENV PATH=$HOME/.local/bin:$PATH
# RUN chown grassroots:grassroots $HOME/.local/
USER grassroots
COPY contract-migration/testdata/pgp testdata/pgp COPY contract-migration/testdata/pgp testdata/pgp
COPY contract-migration/wait-for-it.sh . COPY contract-migration/wait-for-it.sh .
# RUN chmod +x ./wait-for-it.sh
# COPY contract-migration/.env_config_template .env_config_template
# COPY contract-migration/.env_dockercompose_template .env_dockercompose_template
COPY contract-migration/reset.sh reset.sh COPY contract-migration/reset.sh reset.sh
COPY contract-migration/from_env.sh from_env.sh COPY contract-migration/from_env.sh from_env.sh
COPY contract-migration/seed_cic_eth.sh seed_cic_eth.sh COPY contract-migration/seed_cic_eth.sh seed_cic_eth.sh
@ -131,4 +122,14 @@ COPY contract-migration/sarafu_declaration.json sarafu_declaration.json
COPY contract-migration/keystore keystore COPY contract-migration/keystore keystore
COPY contract-migration/envlist . COPY contract-migration/envlist .
# critically, includes the .local folder from compile-image
RUN chown -R grassroots:grassroots .
RUN mkdir -p /tmp/cic/config
RUN chown grassroots:grassroots /tmp/cic/config
# A shared output dir for environment configs
RUN chmod a+rwx /tmp/cic/config
USER grassroots
ENTRYPOINT [ ] ENTRYPOINT [ ]