Emalawi19 commited on
Commit
690dc7d
·
verified ·
1 Parent(s): 3316189

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -16
Dockerfile CHANGED
@@ -13,8 +13,9 @@ RUN a2enmod rewrite headers
13
 
14
  COPY api/ /var/www/api/
15
 
16
- RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf && \
17
- printf '<VirtualHost *:7860>\n\
 
18
  DocumentRoot /var/www/html\n\
19
  Alias /api /var/www/api\n\
20
  <Directory /var/www/api>\n\
@@ -29,19 +30,6 @@ RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf && \
29
  </Directory>\n\
30
  </VirtualHost>\n' > /etc/apache2/sites-enabled/000-default.conf
31
 
32
- # Write entrypoint directly — avoids CRLF line ending issues
33
- RUN printf '#!/bin/bash\n\
34
- set -e\n\
35
- mkdir -p /data/sites /data/sessions /data/logs /data/db\n\
36
- chown -R www-data:www-data /data\n\
37
- DB=/data/db/platform.sqlite\n\
38
- if [ ! -f "$DB" ]; then\n\
39
- sqlite3 "$DB" "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT NOT NULL UNIQUE, created_at TEXT NOT NULL DEFAULT (datetime('"'"'now'"'"')));\n\
40
- CREATE TABLE IF NOT EXISTS files (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT NOT NULL, filepath TEXT NOT NULL, updated_at TEXT NOT NULL DEFAULT (datetime('"'"'now'"'"')), UNIQUE(username, filepath));"\n\
41
- chown www-data:www-data "$DB"\n\
42
- fi\n\
43
- exec apache2-foreground\n' > /entrypoint.sh && chmod +x /entrypoint.sh
44
-
45
  EXPOSE 7860
46
 
47
- CMD ["/bin/bash", "/entrypoint.sh"]
 
13
 
14
  COPY api/ /var/www/api/
15
 
16
+ RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf
17
+
18
+ RUN printf '<VirtualHost *:7860>\n\
19
  DocumentRoot /var/www/html\n\
20
  Alias /api /var/www/api\n\
21
  <Directory /var/www/api>\n\
 
30
  </Directory>\n\
31
  </VirtualHost>\n' > /etc/apache2/sites-enabled/000-default.conf
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  EXPOSE 7860
34
 
35
+ CMD ["apache2-foreground"]