Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
112093bc
Commit
112093bc
authored
Dec 17, 2017
by
Joren Vrancken
Browse files
Update Dockerfile to support sphinx
parent
666e643f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
112093bc
...
...
@@ -19,8 +19,11 @@ CMD ["--help"]
RUN
mkdir
/concrexit
&&
\
mkdir
-p
/concrexit/log/
&&
\
touch
/concrexit/log/uwsgi.log
&&
\
mkdir
-p
/concrexit/docs/
&&
\
chown
-R
www-data:www-data /concrexit
&&
\
mkdir
-p
/usr/src/app
mkdir
-p
/usr/src/app
&&
\
mkdir
-p
/usr/src/app/website
&&
\
mkdir
-p
/usr/src/app/docs
# Install dependencies
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
\
...
...
@@ -29,15 +32,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ghostscript
&&
\
rm
-rf
/var/lib/apt
WORKDIR
/usr/src/app
WORKDIR
/usr/src/app
/website/
# install python requirements
COPY
requirements.txt /usr/src/app/
COPY
production-requirements.txt /usr/src/app/
COPY
dev-requirements.txt /usr/src/app/
COPY
requirements.txt /usr/src/app/website/
COPY
production-requirements.txt /usr/src/app/website/
COPY
dev-requirements.txt /usr/src/app/website/
COPY
docs/requirements.txt /usr/src/app/docs/
RUN
pip
install
--no-cache-dir
\
-r
requirements.txt
\
-r
production-requirements.txt
\
-r
dev-requirements.txt
-r
dev-requirements.txt
\
-r
../docs/requirements.txt
# Create entry points
COPY
resources/entrypoint.sh /usr/local/bin/entrypoint.sh
...
...
@@ -46,4 +51,8 @@ RUN chmod +x /usr/local/bin/entrypoint.sh && \
chmod
+x /usr/local/bin/entrypoint_production.sh
# copy app source
COPY
website /usr/src/app/
COPY
website /usr/src/app/website/
# Copy files for Sphinx documentation
COPY
README.md /usr/src/app/
COPY
docs /usr/src/app/docs
resources/entrypoint.sh
View file @
112093bc
...
...
@@ -2,12 +2,14 @@
set
-e
sphinx-build
-b
html /usr/src/app/docs/ /concrexit/docs/
until
psql
-h
"
$DJANGO_POSTGRES_HOST
"
-U
"postgres"
-c
'\l'
;
do
>
&2
echo
"PostgreSQL is unavailable: Sleeping"
sleep
5
done
>
&2
echo
"PostgreSQL is up"
cd
/usr/src/app
cd
/usr/src/app
/website/
>
&2
echo
"Running ./manage.py
$@
"
./manage.py
$@
resources/entrypoint_production.sh
View file @
112093bc
...
...
@@ -2,17 +2,20 @@
set
-e
>
&2
echo
"Creating Sphinx documentation"
sphinx-build
-b
html /usr/src/app/docs/ /concrexit/docs/
until
psql
-h
"
$DJANGO_POSTGRES_HOST
"
-U
"postgres"
-c
'\l'
;
do
>
&2
echo
"PostgreSQL is unavailable: Sleeping"
sleep
5
done
>
&2
echo
"PostgreSQL is up"
chown
-R
33:33
/concrexit/
chown
-R
www-data:www-data
/concrexit/
cd
/usr/src/app
cd
/usr/src/app
/website/
>
&2
echo
"Running site with uwsgi"
uwsgi
--chdir
/usr/src/app
\
uwsgi
--chdir
/usr/src/app
/website
\
--socket
:8000
\
--socket-timeout
1800
\
--uid
33
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment