CatPtain commited on
Commit
75565db
·
verified ·
1 Parent(s): 13fc742

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +41 -0
  2. docker-compose.yml +22 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM php:8.3-apache
2
+
3
+ ARG UNAME=www-data
4
+ ARG UGROUP=www-data
5
+ ARG UID=1000
6
+ ARG GID=1001
7
+ RUN usermod --uid $UID $UNAME
8
+ RUN groupmod --gid $GID $UGROUP
9
+
10
+ # Install required extensions
11
+ RUN apt-get update && apt-get install -y \
12
+ git \
13
+ curl \
14
+ libcurl4-openssl-dev \
15
+ && docker-php-ext-install curl \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Set working directory
19
+ WORKDIR /var/www/html
20
+
21
+ # Copy application files
22
+ COPY . /var/www/html/
23
+
24
+ # Set permissions
25
+ RUN chown -R www-data:www-data /var/www/html \
26
+ && chmod -R 755 /var/www/html
27
+
28
+ # Enable Apache rewrite module
29
+ RUN a2enmod rewrite
30
+
31
+ # Create uploads directory
32
+ RUN mkdir -p /var/www/html/uploads && chown www-data:www-data /var/www/html/uploads
33
+
34
+ # Expose port
35
+ EXPOSE 7860
36
+
37
+ # Configure Apache to use port 7860 (Hugging Face standard)
38
+ RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf
39
+ RUN sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf
40
+
41
+ CMD ["apache2-foreground"]
docker-compose.yml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # sudo apt install docker-compose
2
+ # sudo docker-compose up -d
3
+ version: '3.8'
4
+ services:
5
+ php:
6
+ build:
7
+ context: .
8
+ dockerfile: Dockerfile
9
+ volumes:
10
+ - ./:/var/www/html
11
+ ports:
12
+ - 7860:7860
13
+ environment:
14
+ # Default demo configuration - override in Hugging Face
15
+ - USER_1_NAME=demo
16
+ - USER_1_PASSWORD=demo123
17
+ - STORAGE_TYPE=github
18
+ - GITHUB_TOKEN=
19
+ - GITHUB_OWNER=
20
+ - GITHUB_REPO=
21
+ - GITHUB_BRANCH=main
22
+ - GITHUB_PATH=pages/