Dockerfile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #-------------------------------------------------------------------------------------------------------------
  2. # Copyright (c) Microsoft Corporation. All rights reserved.
  3. # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
  4. #-------------------------------------------------------------------------------------------------------------
  5. FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-16
  6. # The node image includes a non-root user with sudo access. Use the
  7. # "remoteUser" property in devcontainer.json to use it. On Linux, update
  8. # these values to ensure the container user's UID/GID matches your local values.
  9. # See https://aka.ms/vscode-remote/containers/non-root-user for details.
  10. ARG USERNAME=node
  11. ARG USER_UID=1000
  12. ARG USER_GID=$USER_UID
  13. RUN mkdir -p /workspace/growi/node_modules
  14. RUN mkdir -p /workspace/growi/packages/app/node_modules
  15. RUN mkdir -p /workspace/growi/packages/slackbot-proxy/node_modules
  16. RUN mkdir -p /workspace/growi/packages/app/.next
  17. # [Optional] Update UID/GID if needed
  18. RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
  19. groupmod --gid $USER_GID $USERNAME \
  20. && usermod --uid $USER_UID --gid $USER_GID $USERNAME; \
  21. fi
  22. RUN chown -R $USER_UID:$USER_GID /home/$USERNAME /workspace;
  23. # *************************************************************
  24. # * Uncomment this section to use RUN instructions to install *
  25. # * any needed dependencies after executing "apt-get update". *
  26. # * See https://docs.docker.com/engine/reference/builder/#run *
  27. # *************************************************************
  28. ENV DEBIAN_FRONTEND=noninteractive
  29. # Prepare to install Chrome for VRT
  30. RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
  31. RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
  32. RUN apt-get update \
  33. && apt-get -y install --no-install-recommends git-lfs \
  34. # Chrome
  35. google-chrome-stable \
  36. # for Cypress
  37. libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb fonts-noto-cjk \
  38. # Clean up
  39. && apt-get autoremove -y \
  40. && apt-get clean -y \
  41. && rm -rf /var/lib/apt/lists/*
  42. ENV DEBIAN_FRONTEND=dialog
  43. # Uncomment to default to non-root user
  44. # USER $USER_UID