Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Sam Burney
galdir
Commits
559d33ea
Commit
559d33ea
authored
5 years ago
by
Sam Burney
Browse files
Options
Download
Email Patches
Plain Diff
Update Docker to use Flask-based app
parent
014288ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
20 deletions
+14
-20
Dockerfile
Dockerfile
+1
-2
docker/root/etc/cont-init.d/20-handle-env
docker/root/etc/cont-init.d/20-handle-env
+10
-8
docker/root/etc/services.d/galdir/run
docker/root/etc/services.d/galdir/run
+3
-10
No files found.
Dockerfile
View file @
559d33ea
...
...
@@ -2,8 +2,7 @@ FROM lsiobase/alpine:3.9
LABEL
maintainer 'Sam Burney <sam@burney.io>'
ENV
GALDIR_LISTEN=0.0.0.0:6543 \
GALDIR_SITENAME=GalDir \
ENV
GALDIR_SITENAME="GalDir Docker" \
GALDIR_ALBUMS=albums \
GALDIR_CACHE=cache \
GALDIR_IMAGES_PERPAGE=12
...
...
This diff is collapsed.
Click to expand it.
docker/root/etc/cont-init.d/20-handle-env
View file @
559d33ea
#!/usr/bin/with-contenv bash
# Handle GALDIR_LISTEN GALDIR_SITENAME GALDIR_ALBUMS GALDIR_CACHE GALDIR_IMAGES_PERPAGE env variables
cat
/usr/local/share/galdir/config.ini
\
|
sed
-E
"s/(listen = ).*/
\1
${
GALDIR_LISTEN
}
/"
\
|
sed
-E
"s/(galdir.sitename = ).*/
\1
${
GALDIR_SITENAME
}
/"
\
|
sed
-E
"s/(galdir.dir_albums = ).*/
\1
${
GALDIR_ALBUMS
}
/"
\
|
sed
-E
"s/(galdir.dir_cache = ).*/
\1
${
GALDIR_CACHE
}
/"
\
|
sed
-E
"s/(galdir.images_perpage = ).*/
\1
${
GALDIR_IMAGES_PERPAGE
}
/"
\
>
/usr/local/share/galdir/production.ini
\ No newline at end of file
config_file
=
/usr/local/share/galdir/galdir/config.py
# Initial config.py setup
echo
"DEBUG=False"
>
$config_file
echo
"SECRET_KEY=
$(
python3
-c
'import os; print(os.urandom(16))'
)
"
>>
$config_file
# Handle all GALDIR_* environment variables
for
var
in
${
!GALDIR_*
}
;
do
echo
$var
=
\"
"
${
!var
}
"
\"
>>
$config_file
done
This diff is collapsed.
Click to expand it.
docker/root/etc/services.d/galdir/run
View file @
559d33ea
#!/usr/bin/with-contenv bash
# If config file exists, start daemon
if
[
-f
/usr/local/share/galdir/production.ini
]
;
then
echo
"Starting GalDir Web Server"
echo
"Starting GalDir Web Server"
exec
\
pserve /usr/local/share/galdir/production.ini
else
echo
/usr/local/share/galdir/production.ini config file is missing
fi
exit
1
exec
\
waitress-serve
--listen
=
0.0.0.0:6543
--call
'galdir:create_app'
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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