aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dockerignore3
-rw-r--r--Dockerfile20
-rwxr-xr-xbootstrap.py24
-rw-r--r--conf.py15
-rw-r--r--requirements.txt2
5 files changed, 30 insertions, 34 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..f794bc2
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,3 @@
1.venv
2.idea
3_build
diff --git a/Dockerfile b/Dockerfile
index 49de25f..985f527 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,22 @@
1FROM python:3.6.0 1FROM python:3.6.0 as builder
2 2
3LABEL maintainer=clarkzjw<[email protected]>
3 4
5RUN pip install virtualenv
4 6
5FROM nginx 7COPY requirements.txt /app/requirements.txt
6 8
9COPY bootstrap.py /app/bootstrap.py
10
11RUN /app/bootstrap.py
12
13ADD . /app
14
15WORKDIR /app
16
17RUN /bin/bash -c "source /app/.venv/bin/activate && make html"
18
19
20FROM nginx:alpine
21
22COPY --from=builder /app/_build/html /usr/share/nginx/html
diff --git a/bootstrap.py b/bootstrap.py
index 80d9048..0c07b9d 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -1,4 +1,4 @@
1#!/usr/bin/env python2 1#!/usr/bin/env python3
2from __future__ import absolute_import, print_function, unicode_literals 2from __future__ import absolute_import, print_function, unicode_literals
3 3
4import os 4import os
@@ -16,9 +16,9 @@ def fail(message):
16 16
17def has_module(module_name): 17def has_module(module_name):
18 try: 18 try:
19 import imp 19 import implib
20 imp.find_module(module_name) 20 implib.find_module(module_name)
21 del imp 21 del implib
22 return True 22 return True
23 except ImportError: 23 except ImportError:
24 return False 24 return False
@@ -69,12 +69,11 @@ pip_bin = os.path.join(env_dir, 'bin', 'pip')
69python_bin = os.path.join(env_dir, 'bin', 'python') 69python_bin = os.path.join(env_dir, 'bin', 'python')
70virtualenv_bin = which('virtualenv', throw=False) 70virtualenv_bin = which('virtualenv', throw=False)
71virtualenv_exists = os.path.exists(env_dir) and os.path.isfile(python_bin) 71virtualenv_exists = os.path.exists(env_dir) and os.path.isfile(python_bin)
72sphinx_requirements_filepath = os.path.join( 72sphinx_requirements_filepath = os.path.join(project_dir, 'requirements.txt')
73 project_dir, 'requirements.txt')
74 73
75 74
76try: 75try:
77 import virtualenv # NOQA 76 import virtualenv
78except ImportError: 77except ImportError:
79 message = ( 78 message = (
80 'Virtualenv is required for this bootstrap to run.\n' 79 'Virtualenv is required for this bootstrap to run.\n'
@@ -85,7 +84,7 @@ except ImportError:
85 84
86 85
87try: 86try:
88 import pip # NOQA 87 import pip
89except ImportError: 88except ImportError:
90 message = ( 89 message = (
91 'pip is required for this bootstrap to run.\n' 90 'pip is required for this bootstrap to run.\n'
@@ -96,14 +95,6 @@ except ImportError:
96 95
97 96
98def main(): 97def main():
99 if not which('entr', throw=False):
100 message = (
101 '\nentr(1) is used in this app as a cross platform file watcher.'
102 'You can install it via your package manager on most POSIX '
103 'systems. See the site at http://entrproject.org/\n'
104 )
105 print(message)
106
107 if not virtualenv_exists: 98 if not virtualenv_exists:
108 virtualenv_bin = which('virtualenv', throw=False) 99 virtualenv_bin = which('virtualenv', throw=False)
109 100
@@ -119,5 +110,6 @@ def main():
119 if os.path.exists(os.path.join(env_dir, 'build')): 110 if os.path.exists(os.path.join(env_dir, 'build')):
120 os.removedirs(os.path.join(env_dir, 'build')) 111 os.removedirs(os.path.join(env_dir, 'build'))
121 112
113
122if __name__ == '__main__': 114if __name__ == '__main__':
123 main() 115 main()
diff --git a/conf.py b/conf.py
index 1a7a0c6..31410b0 100644
--- a/conf.py
+++ b/conf.py
@@ -86,18 +86,3 @@ texinfo_documents = [
86 ('index', 'confuciangentlemansclub', u'confucian gentleman\'s club', 'confuciangentlemansclub', 'Scribe.', 86 ('index', 'confuciangentlemansclub', u'confucian gentleman\'s club', 'confuciangentlemansclub', 'Scribe.',
87 'Miscellaneous'), 87 'Miscellaneous'),
88] 88]
89
90intersphinx_mapping = {
91 'https://docs.python.org/2/': None,
92 'sphinx': ('https://sphinx.readthedocs.io/en/latest/', None),
93 'django': (
94 'https://docs.djangoproject.com/en/1.11/',
95 'https://docs.djangoproject.com/en/1.11/_objects/'
96 ),
97 'flask': ('http://flask.pocoo.org/docs/', None),
98 'flask-sqlalchemy': ('http://flask-sqlalchemy.pocoo.org/2.2/', None),
99 'werkzeug': ('http://werkzeug.pocoo.org/docs/0.12/', None),
100 'jinja': ('http://jinja.pocoo.org/docs/dev', None),
101 'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None),
102 'uwsgi': ('https://uwsgi-docs.readthedocs.io/en/latest/', None),
103}
diff --git a/requirements.txt b/requirements.txt
index 76a6e69..5d75587 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -13,6 +13,6 @@ pytz==2017.3
13requests==2.18.4 13requests==2.18.4
14six==1.11.0 14six==1.11.0
15snowballstemmer==1.2.1 15snowballstemmer==1.2.1
16Sphinx==1.6.6 16Sphinx
17sphinxcontrib-websupport==1.0.1 17sphinxcontrib-websupport==1.0.1
18urllib3==1.22 18urllib3==1.22
Powered by cgit v1.2.3 (git 2.41.0)