Dockerfile 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. RUN apt clean
  12. # https://getcomposer.org/download/
  13. RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet --install-dir=/usr/local/bin --filename=composer
  14. RUN useradd -s /bin/bash -m deploy
  15. RUN passwd -l deploy
  16. RUN echo 'deploy ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/101-deploy
  17. RUN mkdir /opt/tulip
  18. RUN chown deploy:deploy /opt/tulip
  19. USER deploy
  20. COPY tulip /opt/tulip/
  21. RUN cd /opt/tulip && composer install
  22. RUN echo "$(date -u +%4Y%m%d%H%M%S)" | sudo tee /VERSION
  23. WORKDIR /opt/tulip
  24. CMD ["/bin/bash", "-l"]