Skip to content
Snippets Groups Projects
Dockerfile 1.36 KiB
Newer Older
  • Learn to ignore specific revisions
  • FROM ubuntu:focal AS installer
    
    Vincent Sellier's avatar
    Vincent Sellier committed
    
    
    ARG COZY_VERSION=1.5.8
    ARG NODE_VERSION=16.19.0
    ARG DEBIAN_FRONTEND=noninteractive
    
    Vincent Sellier's avatar
    Vincent Sellier committed
    
    WORKDIR /tmp
    
    
    RUN apt-get update && apt-get -y install wget xz-utils
    
    Vincent Sellier's avatar
    Vincent Sellier committed
    
    COPY install.sh /
    RUN chmod u+x /install.sh
    RUN /install.sh
    
    
    FROM ubuntu:focal
    
    ARG DEBIAN_FRONTEND=noninteractive
    
    Vincent Sellier's avatar
    Vincent Sellier committed
    
    
    RUN apt-get update && apt-get -y install git imagemagick \
      && rm -rf /var/cache/apt
    
    RUN sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
    
    RUN groupadd --gid 1000 cozy && useradd --gid 1000 --uid 1000 -m -d /usr/local/cozy-stack cozy \
      && mkdir /etc/cozy && chown cozy:cozy /etc/cozy \
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
      && mkdir /usr/local/cozy-stack/scripts && chown cozy:cozy /usr/local/cozy-stack/scripts
    
    Vincent Sellier's avatar
    Vincent Sellier committed
    
    
    COPY --chown=cozy:cozy --from=installer /tmp/cozy /usr/local/cozy-stack/cozy
    COPY --chown=cozy:cozy --from=installer /tmp/node /usr/local/node
    COPY --chown=cozy:cozy entrypoint.sh /entrypoint.sh
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    COPY --chown=cozy:cozy cozy.yaml /etc/cozy/cozy.yaml
    
    ADD --chown=cozy:cozy https://raw.githubusercontent.com/cozy/cozy-stack/master/scripts/konnector-node-run.sh /usr/local/cozy-stack/scripts/
    
    Vincent Sellier's avatar
    Vincent Sellier committed
    
    
    RUN chmod u+x /entrypoint.sh /usr/local/cozy-stack/scripts/konnector-node-run.sh
    
    # Raspberry hack for node
    RUN ln -s /usr/local/node/bin/node /usr/bin/node
    
    Vincent Sellier's avatar
    Vincent Sellier committed
    
    USER cozy
    
    ENV COZY_ADMIN_PASSPHRASE=changeme
    
    WORKDIR /usr/local/cozy-stack
    ENTRYPOINT [ "/entrypoint.sh" ]