Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ARG PHP_VERSION=8.3
  2. ARG NVM_VERSION=22
  3. FROM php:${PHP_VERSION}-apache
  4. RUN apt-get update && apt-get install -y \
  5. libfreetype6-dev \
  6. libpng-dev \
  7. libwebp-dev \
  8. libjpeg62-turbo-dev \
  9. libmcrypt-dev \
  10. libzip-dev \
  11. zip \
  12. git \
  13. libxpm-dev \
  14. libonig-dev \
  15. && docker-php-ext-configure gd \
  16. --with-jpeg \
  17. --with-freetype \
  18. && docker-php-ext-install \
  19. mbstring \
  20. mysqli \
  21. pdo_mysql \
  22. gd \
  23. zip \
  24. && pecl install xdebug \
  25. && docker-php-ext-enable xdebug \
  26. && a2enmod \
  27. rewrite
  28. # Add the user UID:1000, GID:1000, home at /app
  29. RUN groupadd -r app -g 1000 && useradd -u 1000 -r -g app -m -d /app -s /sbin/nologin -c "App user" app && \
  30. chmod 755 /var/www/html
  31. RUN php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer
  32. RUN echo "ServerName localhost" | tee -a /etc/apache2/httpd.conf
  33. USER app
  34. WORKDIR /var/www/html
  35. USER root
  36. # Set environment variables
  37. ENV NVM_DIR /root/.nvm
  38. # Install curl, and download and install nvm
  39. RUN apt-get update && \
  40. apt-get install -y curl && \
  41. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash && \
  42. . "$NVM_DIR/nvm.sh" && \
  43. nvm install 22 && \
  44. npm install npm@latest -g && \
  45. npm install n -g && \
  46. n latest
  47. # Set the PATH to include nvm binaries
  48. ENV PATH $NVM_DIR/versions/node/$(nvm version)/bin:$PATH
  49. ENV WORKSPACE_FOLDER=/var/www/html
  50. RUN npm install tailwindcss @tailwindcss/vite
  51. EXPOSE 80
  52. EXPOSE 5173