-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
31c363c
commit adef805
Showing
5 changed files
with
148 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,20 @@ | ||
FROM ubuntu:18.04 | ||
|
||
ENV LC_ALL C.UTF-8 | ||
ENV LANG C.UTF-8 | ||
ENV UID 1000 | ||
ENV GID 1000 | ||
|
||
ADD . /opt/policelab-server | ||
WORKDIR /opt/policelab-server | ||
|
||
RUN groupadd -g $GID policelab-server && useradd -u $UID -g policelab-server policelab-server | ||
|
||
RUN apt update && \ | ||
apt install -y python3 python3-pip supervisor && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip3 --no-cache-dir install pipenv | ||
|
||
RUN pipenv install --system --deploy | ||
|
||
ENTRYPOINT supervisord -n -c /etc/supervisor/supervisord.conf |
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,13 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
django = "*" | ||
gunicorn = "*" | ||
|
||
[requires] | ||
python_version = "3.7" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,36 @@ | ||
version: '3' | ||
services: | ||
nginx: | ||
image: nginx:1.17.6-alpine | ||
ports: | ||
- '80:80' | ||
- '8000:8000' | ||
volumes: | ||
- ${WWW_DIR}:/var/www | ||
- ${NGINX_LOG_DIR}:/var/log/nginx | ||
- ./conf.d/nginx:/etc/nginx/conf.d:ro | ||
depends_on: | ||
- policelab-server | ||
|
||
mariadb: | ||
image: mariadb:10.4.11-bionic | ||
volumes: | ||
- ${MARIA_DATA_DIR}:/var/lib/mysql | ||
- ./conf.d/mariadb:/etc/mysql/conf.d:ro | ||
environment: | ||
- 'MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}' | ||
|
||
policelab-server: | ||
build: . | ||
volumes: | ||
- ${WWW_DIR}:/var/www | ||
- ${APP_SRC_DIR}:/opt/policelab-server | ||
- ${SUPERVISOR_LOG_DIR}:/var/log/supervisor | ||
- ./conf.d/supervisor:/etc/supervisor:ro | ||
- /etc/localtime:/etc/localtime:ro | ||
- /etc/timezone:/etc/timezone:ro | ||
environment: | ||
- 'UID=${UID}' | ||
- 'GID=${GID}' | ||
depends_on: | ||
- mariadb |
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,21 @@ | ||
#!/usr/bin/env python | ||
"""Django's command-line utility for administrative tasks.""" | ||
import os | ||
import sys | ||
|
||
|
||
def main(): | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings') | ||
try: | ||
from django.core.management import execute_from_command_line | ||
except ImportError as exc: | ||
raise ImportError( | ||
"Couldn't import Django. Are you sure it's installed and " | ||
"available on your PYTHONPATH environment variable? Did you " | ||
"forget to activate a virtual environment?" | ||
) from exc | ||
execute_from_command_line(sys.argv) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |