sd
Browse filesfda
- Dockerfile +66 -0
- README.md +10 -0
Dockerfile
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official PHP image
|
2 |
+
FROM php:8.2-apache
|
3 |
+
|
4 |
+
# Install necessary packages and PHP extensions
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
wget \
|
7 |
+
git \
|
8 |
+
gnupg \
|
9 |
+
lsb-release \
|
10 |
+
apt-transport-https \
|
11 |
+
ca-certificates \
|
12 |
+
libpq-dev \
|
13 |
+
libsqlite3-dev \
|
14 |
+
zip \
|
15 |
+
unzip \
|
16 |
+
&& docker-php-ext-install pgsql pdo_pgsql pdo_sqlite
|
17 |
+
|
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/laravel
|
29 |
+
|
30 |
+
|
31 |
+
# Download and set up phpMyAdmin from GitHub
|
32 |
+
RUN wget https://github.com/phpmyadmin/phpmyadmin/archive/refs/tags/RELEASE_5_1_4.tar.gz -O phpmyadmin.tar.gz \
|
33 |
+
&& tar -xzvf phpmyadmin.tar.gz -C /var/www/html --strip-components=1 \
|
34 |
+
&& rm phpmyadmin.tar.gz
|
35 |
+
|
36 |
+
|
37 |
+
# Change Apache to listen on port 7860
|
38 |
+
RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf \
|
39 |
+
&& sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf
|
40 |
+
|
41 |
+
# Set correct permissions for directories
|
42 |
+
RUN chmod -R 777 /var/ \
|
43 |
+
&& chmod -R 777 /etc/apache2/
|
44 |
+
|
45 |
+
# Set correct permissions for phpMyAdmin configuration file
|
46 |
+
# (if applicable, ensure the file exists first)
|
47 |
+
RUN [ -f /var/www/html/phpmyadmin/config.inc.php ] && chmod 644 /var/www/html/phpmyadmin/config.inc.php || true
|
48 |
+
|
49 |
+
# Copy all contents of the app folder to the /var/www/html/ directory
|
50 |
+
COPY ./php/ /var/www/html/
|
51 |
+
|
52 |
+
# Ensure the SQLite database file and directory have the correct permissions
|
53 |
+
RUN chown -R www-data:www-data /var/www/html/ \
|
54 |
+
&& chmod -R 777 /var/www/html/
|
55 |
+
|
56 |
+
# Set environment variables
|
57 |
+
ENV PMA_HOST=mysql-7364790-localbugtv.l.aivencloud.com
|
58 |
+
ENV PMA_PORT=10490
|
59 |
+
ENV MYSQL_ROOT_PASSWORD=root
|
60 |
+
ENV APACHE_PORT=7860
|
61 |
+
|
62 |
+
# Expose the Apache port
|
63 |
+
EXPOSE 7860
|
64 |
+
|
65 |
+
# Start Apache
|
66 |
+
CMD ["apache2-foreground"]
|
README.md
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: php
|
3 |
+
emoji: 🚀
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: blue
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
---
|
9 |
+
|
10 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|