mirror of
https://github.com/partitioncloud/partitioncloud-server.git
synced 2025-01-23 09:16:25 +01:00
Add Dockerfile
This commit is contained in:
parent
5d0535ef70
commit
3cbc586c78
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
FROM python:latest
|
||||
|
||||
WORKDIR /app
|
||||
EXPOSE 5000
|
||||
|
||||
COPY . /app
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y python3-pip sqlite3 ghostscript
|
||||
|
||||
RUN rm /app/instance -rf
|
||||
RUN bash make.sh init
|
||||
RUN pip3 install -r requirements.txt
|
||||
RUN pip3 install gunicorn
|
||||
|
||||
|
||||
CMD [ "bash", "make.sh" , "production"]
|
@ -97,4 +97,4 @@ pybabel update -i partitioncloud/translations/messages.pot -d partitioncloud/tra
|
||||
- [ ] Ajouter config:DISABLE_DARK_MODE
|
||||
- [x] Ajouter config:DISABLE_REGISTER
|
||||
- [ ] Ajouter config:ONLINE_SEARCH_BASE_QUERY pour la recherche google, actuellement 'filetype:pdf partition'
|
||||
- [ ] Ajouter un Dockerfile
|
||||
- [x] Ajouter un Dockerfile
|
||||
|
9
make.sh
9
make.sh
@ -18,6 +18,7 @@ init () {
|
||||
printf "Souhaitez vous supprimer la base de données existante ? [y/n] "
|
||||
read -r CONFIRMATION
|
||||
[[ $CONFIRMATION == y ]] || exit 1
|
||||
rm "$INSTANCE_PATH/partitioncloud.sqlite"
|
||||
fi
|
||||
sqlite3 "$INSTANCE_PATH/partitioncloud.sqlite" '.read partitioncloud/schema.sql'
|
||||
echo "Base de données créé"
|
||||
@ -40,7 +41,7 @@ start () {
|
||||
|
||||
production () {
|
||||
pybabel compile -d partitioncloud/translations/
|
||||
FLASK_APP=partitioncloud /usr/bin/gunicorn \
|
||||
FLASK_APP=partitioncloud gunicorn \
|
||||
wsgi:app \
|
||||
--bind 0.0.0.0:$PORT
|
||||
}
|
||||
@ -65,7 +66,11 @@ RESULT=$(type "$1")
|
||||
if [[ $1 && $RESULT = *"is a"*"function"* || $RESULT == *"est une fonction"* ]]; then
|
||||
# Import config
|
||||
load_config "default_config.py"
|
||||
[[ ! -x "$INSTANCE_PATH/config.py" ]] && load_config "$INSTANCE_PATH/config.py"
|
||||
|
||||
if test -f "instance/config.py"; then
|
||||
load_config "instance/config.py"
|
||||
fi
|
||||
|
||||
$1 ${*:2} # Call the function
|
||||
else
|
||||
usage
|
||||
|
Loading…
Reference in New Issue
Block a user