Dockerfile 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. FROM ubuntu:latest
  2. LABEL maintainer="Jeremy Zheng"
  3. ENV DEBIAN_FRONTEND noninteractive
  4. RUN apt update
  5. RUN apt install -y apt-utils debian-keyring debian-archive-keyring apt-transport-https software-properties-common gnupg
  6. RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
  7. RUN apt -y upgrade
  8. ENV PHP_VERSION="8.2"
  9. RUN apt install -y sudo wget unzip \
  10. php${PHP_VERSION}-zip php${PHP_VERSION}-grpc php${PHP_VERSION}-protobuf \
  11. php-grpc-all-dev
  12. RUN apt clean
  13. # https://getcomposer.org/download/
  14. RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet --install-dir=/usr/local/bin --filename=composer
  15. RUN useradd -s /bin/bash -m deploy
  16. RUN passwd -l deploy
  17. RUN echo 'deploy ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/101-deploy
  18. RUN mkdir /opt/morus
  19. RUN chown deploy:deploy /opt/morus
  20. USER deploy
  21. COPY morus /opt/morus/
  22. RUN cd /opt/morus && composer install
  23. RUN echo "$(date -u +%4Y%m%d%H%M%S)" | sudo tee /VERSION
  24. WORKDIR /opt/morus
  25. CMD ["/bin/bash"]