-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM debian:latest | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y python3 python3-dev python3-pip python3-venv apache2 apache2-dev libapache2-mod-wsgi-py3 | ||
RUN apt-get install -y wget ca-certificates make gcc musl-dev | ||
|
||
COPY apache2.conf /etc/apache2/ | ||
WORKDIR /data/local/app | ||
COPY . /data/local/app | ||
|
||
RUN python3 -m venv /data/local/venv | ||
# Enable venv | ||
ENV PATH="/data/local/venv/bin:$PATH" | ||
RUN pip install -U pip setuptools wheel | ||
RUN pip install --no-cache-dir mod_wsgi | ||
RUN pip install -r requirements.txt | ||
|
||
RUN mkdir /flask_session | ||
RUN chown www-data /flask_session | ||
RUN chgrp www-data /flask_session | ||
|
||
EXPOSE 80 | ||
|
||
CMD [ "apachectl", "-D", "FOREGROUND" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
DefaultRuntimeDir ${APACHE_RUN_DIR} | ||
|
||
PidFile ${APACHE_PID_FILE} | ||
|
||
Timeout 10 | ||
|
||
KeepAlive On | ||
|
||
MaxKeepAliveRequests 100 | ||
WSGIScriptAlias / /data/local/app/app.wsgi | ||
WSGIDaemonProcess app user=www-data group=www-data threads=15 processes=1 python-path=/data/local/venv/lib/python3.11/site-packages:/data/local/app | ||
WSGIProcessGroup app | ||
|
||
<Directory /data/local/app> | ||
Require all granted | ||
</Directory> | ||
|
||
Alias /css /data/local/app/css | ||
<Location /css> | ||
Require all granted | ||
</Location> | ||
|
||
Alias /img /data/local/app/img | ||
<Location /img> | ||
Require all granted | ||
</Location> | ||
|
||
Alias /js /data/local/app/js | ||
<Location /js> | ||
Require all granted | ||
</Location> | ||
|
||
KeepAliveTimeout 5 | ||
|
||
# These need to be set in /etc/apache2/envvars | ||
User ${APACHE_RUN_USER} | ||
Group ${APACHE_RUN_GROUP} | ||
|
||
# | ||
# HostnameLookups: Log the names of clients or just their IP addresses | ||
# e.g., www.apache.org (on) or 204.62.129.132 (off). | ||
# The default is off because it'd be overall better for the net if people | ||
# had to knowingly turn this feature on, since enabling it means that | ||
# each client request will result in AT LEAST one lookup request to the | ||
# nameserver. | ||
# | ||
HostnameLookups Off | ||
|
||
# ErrorLog: The location of the error log file. | ||
# If you do not specify an ErrorLog directive within a <VirtualHost> | ||
# container, error messages relating to that virtual host will be | ||
# logged here. If you *do* define an error logfile for a <VirtualHost> | ||
# container, that host's errors will be logged there and not here. | ||
# | ||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
|
||
# | ||
# LogLevel: Control the severity of messages logged to the error_log. | ||
# Available values: trace8, ..., trace1, debug, info, notice, warn, | ||
# error, crit, alert, emerg. | ||
# It is also possible to configure the log level for particular modules, e.g. | ||
# "LogLevel info ssl:warn" | ||
# | ||
LogLevel warn | ||
|
||
# Include module configuration: | ||
IncludeOptional mods-enabled/*.load | ||
IncludeOptional mods-enabled/*.conf | ||
|
||
# Include list of ports to listen on | ||
Include ports.conf | ||
|
||
<Directory /> | ||
Options FollowSymLinks | ||
AllowOverride None | ||
Require all denied | ||
</Directory> | ||
|
||
<FilesMatch "^\.ht"> | ||
Require all denied | ||
</FilesMatch> | ||
|
||
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined | ||
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined | ||
LogFormat "%h %l %u %t \"%r\" %>s %O" common | ||
LogFormat "%{Referer}i -> %U" referer | ||
LogFormat "%{User-agent}i" agent | ||
|
||
ServerName localhost |