Dockerfile 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Builder
  2. FROM --platform=$BUILDPLATFORM node:16-buster as builder
  3. # Support custom branches of the react-sdk and js-sdk. This also helps us build
  4. # images of element-web develop.
  5. ARG USE_CUSTOM_SDKS=false
  6. ARG REACT_SDK_REPO="https://github.com/matrix-org/matrix-react-sdk.git"
  7. ARG REACT_SDK_BRANCH="master"
  8. ARG JS_SDK_REPO="https://github.com/matrix-org/matrix-js-sdk.git"
  9. ARG JS_SDK_BRANCH="master"
  10. RUN apt-get update && apt-get install -y git dos2unix
  11. WORKDIR /src
  12. COPY . /src
  13. RUN dos2unix /src/scripts/docker-link-repos.sh && bash /src/scripts/docker-link-repos.sh
  14. RUN yarn --network-timeout=100000 install
  15. RUN dos2unix /src/scripts/docker-package.sh && bash /src/scripts/docker-package.sh
  16. # Copy the config now so that we don't create another layer in the app image
  17. RUN cp /src/config.sample.json /src/webapp/config.json
  18. # App
  19. FROM nginx:alpine
  20. COPY --from=builder /src/webapp /app
  21. # Override default nginx config
  22. COPY /nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
  23. RUN rm -rf /usr/share/nginx/html \
  24. && ln -s /app /usr/share/nginx/html