File size: 1,933 Bytes
4ee3aa4
833e7d7
 
 
 
 
 
 
 
 
 
 
 
 
6078bfe
833e7d7
 
 
 
db52a47
 
 
833e7d7
 
 
db52a47
5c4c019
833e7d7
 
 
db52a47
833e7d7
 
 
 
 
 
 
db52a47
 
 
 
 
 
 
 
 
833e7d7
 
db52a47
a8257f4
833e7d7
 
 
 
 
 
 
 
 
 
 
db52a47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM php:8.2-apache

# Install necessary packages and PHP extensions
RUN apt-get update && apt-get install -y \
    wget \
    git \
    gnupg \
    lsb-release \
    apt-transport-https \
    ca-certificates \
    libpq-dev \
    libsqlite3-dev \
    zip \
    unzip \
    && docker-php-ext-install pgsql pdo_pgsql pdo_sqlite mysqli pdo_mysql

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Install Laravel
RUN composer global require laravel/installer

# Set environment variables for Composer
ENV PATH="$PATH:/root/.composer/vendor/bin"

# Create a new Laravel project
RUN laravel new /var/www/html

# Download and set up phpMyAdmin from GitHub
RUN wget https://github.com/phpmyadmin/phpmyadmin/archive/refs/tags/RELEASE_5_1_4.tar.gz -O phpmyadmin.tar.gz \
    && tar -xzvf phpmyadmin.tar.gz -C /var/www/html --strip-components=1 \
    && rm phpmyadmin.tar.gz

# Change Apache to listen on port 7860
RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf \
    && sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf

# Set correct permissions for directories
RUN chmod -R 777 /var/ \
    && chmod -R 777 /etc/apache2/

# Set correct permissions for phpMyAdmin configuration file
# (if applicable, ensure the file exists first)
RUN [ -f /var/www/html/phpmyadmin/config.inc.php ] && chmod 644 /var/www/html/phpmyadmin/config.inc.php || true

# Copy all contents of the app folder to the /var/www/html/ directory
COPY ./php/ /var/www/html/

# Ensure the SQLite database file and directory have the correct permissions
RUN chown -R www-data:www-data /var/www/html/ \
    && chmod -R 777 /var/www/html/ && chmod -R 777 /var/www/html/vendor

# Set environment variables
ENV PMA_HOST=mysql-7364790-localbugtv.l.aivencloud.com
ENV PMA_PORT=10490
ENV MYSQL_ROOT_PASSWORD=root
ENV APACHE_PORT=7860

# Expose the Apache port
EXPOSE 7860

# Start Apache
CMD ["apache2-foreground"]