kenken999 commited on
Commit
71b35d8
·
1 Parent(s): f299527
Files changed (1) hide show
  1. Dockerfile +16 -16
Dockerfile CHANGED
@@ -18,18 +18,22 @@ RUN apt-get update && apt-get install -y \
18
  # Install Composer
19
  COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
20
 
21
- # Install Laravel
22
- RUN composer global require laravel/installer
23
-
24
  # Set environment variables for Composer
25
  ENV PATH="$PATH:/root/.composer/vendor/bin"
26
 
 
 
 
27
  # Create a new Laravel project
28
- RUN laravel new /var/www/html
 
 
 
29
 
30
  # Download and set up phpMyAdmin from GitHub
31
  RUN wget https://github.com/phpmyadmin/phpmyadmin/archive/refs/tags/RELEASE_5_1_4.tar.gz -O phpmyadmin.tar.gz \
32
- && tar -xzvf phpmyadmin.tar.gz -C /var/www/html --strip-components=1 \
 
33
  && rm phpmyadmin.tar.gz
34
 
35
  # Change Apache to listen on port 7860
@@ -37,19 +41,15 @@ RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf \
37
  && sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf
38
 
39
  # Set correct permissions for directories
40
- RUN chmod -R 777 /var/ \
41
- && chmod -R 777 /etc/apache2/
42
-
43
- # Set correct permissions for phpMyAdmin configuration file
44
- # (if applicable, ensure the file exists first)
45
- RUN [ -f /var/www/html/phpmyadmin/config.inc.php ] && chmod 644 /var/www/html/phpmyadmin/config.inc.php || true
46
-
47
- # Copy all contents of the app folder to the /var/www/html/ directory
48
- COPY ./php/ /var/www/html/
49
 
50
  # Ensure the SQLite database file and directory have the correct permissions
51
- RUN chown -R www-data:www-data /var/www/html/ \
52
- && chmod -R 777 /var/www/html/
 
 
53
 
54
  # Set environment variables
55
  ENV PMA_HOST=mysql-7364790-localbugtv.l.aivencloud.com
 
18
  # Install Composer
19
  COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
20
 
 
 
 
21
  # Set environment variables for Composer
22
  ENV PATH="$PATH:/root/.composer/vendor/bin"
23
 
24
+ # Install Laravel installer
25
+ RUN composer global require laravel/installer
26
+
27
  # Create a new Laravel project
28
+ RUN laravel new /var/www/laravel
29
+
30
+ # Move Laravel project to the web root
31
+ RUN mv /var/www/laravel/* /var/www/html/
32
 
33
  # Download and set up phpMyAdmin from GitHub
34
  RUN wget https://github.com/phpmyadmin/phpmyadmin/archive/refs/tags/RELEASE_5_1_4.tar.gz -O phpmyadmin.tar.gz \
35
+ && tar -xzvf phpmyadmin.tar.gz -C /var/www/ \
36
+ && mv /var/www/phpmyadmin-RELEASE_5_1_4 /var/www/html/phpmyadmin \
37
  && rm phpmyadmin.tar.gz
38
 
39
  # Change Apache to listen on port 7860
 
41
  && sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf
42
 
43
  # Set correct permissions for directories
44
+ RUN chown -R www-data:www-data /var/www/html \
45
+ && find /var/www/html -type d -exec chmod 755 {} \; \
46
+ && find /var/www/html -type f -exec chmod 644 {} \;
 
 
 
 
 
 
47
 
48
  # Ensure the SQLite database file and directory have the correct permissions
49
+ RUN chown -R www-data:www-data /var/www/html/storage \
50
+ && chown -R www-data:www-data /var/www/html/bootstrap/cache \
51
+ && chmod -R 775 /var/www/html/storage \
52
+ && chmod -R 775 /var/www/html/bootstrap/cache
53
 
54
  # Set environment variables
55
  ENV PMA_HOST=mysql-7364790-localbugtv.l.aivencloud.com