Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:22.04
|
| 2 |
+
|
| 3 |
+
# Prevent interactive prompts during installation
|
| 4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
+
|
| 6 |
+
# Install Nginx, PHP 8.1, and MariaDB
|
| 7 |
+
RUN apt-get update && apt-get install -y \
|
| 8 |
+
nginx \
|
| 9 |
+
php8.1-fpm \
|
| 10 |
+
php8.1-mysql \
|
| 11 |
+
php8.1-cli \
|
| 12 |
+
mariadb-server \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# Copy configuration and startup scripts
|
| 16 |
+
COPY nginx.conf /etc/nginx/sites-available/default
|
| 17 |
+
COPY start.sh /start.sh
|
| 18 |
+
RUN chmod +x /start.sh
|
| 19 |
+
|
| 20 |
+
# Set up the default web directory where users' PHP files will go
|
| 21 |
+
RUN mkdir -p /var/www/html && chown -R www-data:www-data /var/www/html
|
| 22 |
+
|
| 23 |
+
# Hugging Face requires port 7860
|
| 24 |
+
EXPOSE 7860
|
| 25 |
+
|
| 26 |
+
# Run the startup script
|
| 27 |
+
CMD ["/start.sh"]
|