Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chiefs
ChiefSend
Commits
91a1ee9f
Commit
91a1ee9f
authored
Oct 03, 2020
by
Lukas Böhm
Browse files
docker volume
data now remains persistent even if container is not running
parent
6579b11e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
91a1ee9f
FROM
python:3.8-alpine
WORKDIR
/home
/chiefsend
WORKDIR
/chiefsend
COPY
./requirements.txt ./requirements.txt
RUN
pip
install
-r
requirements.txt
...
...
@@ -18,5 +18,5 @@ ENV FLASK_APP chiefsend.py
EXPOSE
5000
ENTRYPOINT
gunicorn -b :5000 --access-logfile - --error-logfile - chiefsend:app
ENTRYPOINT
gunicorn -b :5000 --access-logfile - --error-logfile - chiefsend:app
\ No newline at end of file
README.md
View file @
91a1ee9f
...
...
@@ -2,7 +2,21 @@
Eine Tolle Webapp zum Austausch von Dateien
## Installation
`git clone https://gitlab.cs.fau.de/ib49uquh/chiefsend.git`
`cd chiefsend`
`docker volume create chiefsend-vol`
`docker build -t chiefsend:latest .`
`docker run --name chiefsend-test -d -p 8000:5000 --rm chiefsend:latest`
\ No newline at end of file
`docker run --name chiefsend-test -d -p 8000:5000 --mount source=chiefsend-vol,target=/chiefsend --rm chiefsend:latest`
## Removing
`docker container stop chiefsend-test`
`docker container rm chiefsend-test`
`docker volume rm chiefsend-vol`
app/__init__.py
View file @
91a1ee9f
...
...
@@ -2,7 +2,9 @@ import os
from
flask
import
Flask
from
flask_sqlalchemy
import
SQLAlchemy
print
(
'WE GOIN IN BOIS'
)
basedir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
))
print
(
basedir
)
app
=
Flask
(
__name__
)
app
.
config
[
'SECRET_KEY'
]
=
os
.
getenv
(
'SECRET_KEY'
)
or
'jonas ist ein kek'
...
...
app/routes.py
View file @
91a1ee9f
...
...
@@ -27,6 +27,7 @@ def remove_share(sh):
def
remove_expired
():
print
(
'cleaning up!'
)
with
app
.
app_context
():
expired_shares
=
Share
.
query
.
filter
(
datetime
.
now
()
>
Share
.
expires
).
all
()
for
sh
in
expired_shares
:
...
...
Write
Preview
Supports
Markdown
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