Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
5ad0b1f1
Verified
Commit
5ad0b1f1
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
[Docker] Place all data under one volume.
Eases deployment, especially on hosters that charge per volume.
parent
c21bfaa0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#155
passed
5 years ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+6
-8
6 additions, 8 deletions
Dockerfile
docker/entrypoint.sh
+4
-4
4 additions, 4 deletions
docker/entrypoint.sh
docker/nginx/Dockerfile
+1
-1
1 addition, 1 deletion
docker/nginx/Dockerfile
docker/nginx/nginx.conf
+2
-2
2 additions, 2 deletions
docker/nginx/nginx.conf
with
13 additions
and
15 deletions
Dockerfile
+
6
−
8
View file @
5ad0b1f1
...
...
@@ -8,8 +8,9 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV
PIP_NO_CACHE_DIR 1
# Configure app settings for build and runtime
ENV
BISCUIT_static__root /srv/static
ENV
BISCUIT_media__root /srv/media
ENV
BISCUIT_static__root /var/lib/biscuit/static
ENV
BISCUIT_media__root /var/lib/biscuit/media
ENV
BISCUIT_backup__location /var/lib/biscuit/backups
# FIXME Use poetry pre-release for external build
ENV
POETRY_VERSION 1.0.0b3
...
...
@@ -36,7 +37,7 @@ RUN pip install "poetry==$POETRY_VERSION"; \
# Install core
COPY
biscuit ./biscuit/
COPY
LICENSE README.md manage.py ./
RUN
mkdir
/etc
/biscuit
/srv
/media /
srv
/static /var/
backups
/biscuit
;
\
RUN
mkdir
-p
/var/lib
/biscuit/media /
var/lib/biscuit
/static /var/
lib
/biscuit
/backups
;
\
poetry build
&&
pip
install
dist/
*
.whl
# Build messages and assets
...
...
@@ -54,11 +55,8 @@ RUN apt-get remove --purge -y \
apt-get clean
-y
;
\
rm
-f
/var/lib/apt/lists/
*
_
*
# Mark configuration as mountableg from the host
VOLUME
/etc/biscuit
VOLUME
/srv/media
VOLUME
/srv/static
VOLUME
/var/backups/biscuit
# Declare a persistent volume for all data
VOLUME
/var/lib/biscuit
# Define entrypoint and gunicorn running on port 8000
EXPOSE
8000
...
...
This diff is collapsed.
Click to expand it.
docker/entrypoint.sh
+
4
−
4
View file @
5ad0b1f1
...
...
@@ -6,11 +6,11 @@ export BISCUIT_database__host=${BISCUIT_database__host:-127.0.0.1}
export
BISCUIT_database__port
=
${
BISCUIT_database__port
:-
5432
}
if
[[
-z
$BISCUIT_secret_key
]]
;
then
if
[[
!
-e
/
etc
/biscuit/secret_key
]]
;
then
touch
/
etc
/biscuit/secret_key
;
chmod
600 /
etc
/biscuit/secret_key
LC_ALL
=
C
tr
-dc
'A-Za-z0-9!"#$%&'
\'
'()*+,-./:;<=>?@[\]^_`{|}~'
</dev/urandom |
head
-c
64
>
/
etc
/biscuit/secret_key
if
[[
!
-e
/
var/lib
/biscuit/secret_key
]]
;
then
touch
/
var/lib
/biscuit/secret_key
;
chmod
600 /
var/lib
/biscuit/secret_key
LC_ALL
=
C
tr
-dc
'A-Za-z0-9!"#$%&'
\'
'()*+,-./:;<=>?@[\]^_`{|}~'
</dev/urandom |
head
-c
64
>
/
var/lib
/biscuit/secret_key
fi
BISCUIT_secret_key
=
$(
</
etc
/biscuit/secret_key
)
BISCUIT_secret_key
=
$(
</
var/lib
/biscuit/secret_key
)
fi
while
!
nc
-z
$BISCUIT_database__host
$BISCUIT_database__port
;
do
...
...
This diff is collapsed.
Click to expand it.
docker/nginx/Dockerfile
+
1
−
1
View file @
5ad0b1f1
...
...
@@ -6,4 +6,4 @@ COPY nginx.conf /etc/nginx/conf.d
RUN
apt-get update
&&
apt-get upgrade
-y
RUN
apt-get
install
-y
libjs-bootstrap4 fonts-font-awesome libjs-jquery libjs-popper.js libjs-jquery-datatables
RUN
mkdir
/
srv/media /srv/static
RUN
mkdir
/
var/lib/biscuit
This diff is collapsed.
Click to expand it.
docker/nginx/nginx.conf
+
2
−
2
View file @
5ad0b1f1
...
...
@@ -13,11 +13,11 @@ server {
}
location
/media/
{
alias
/
srv
/media/
;
alias
/
var/lib/biscuit
/media/
;
}
location
/static/
{
alias
/
srv
/static/
;
alias
/
var/lib/biscuit
/static/
;
}
location
/javascript/
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment