Commit 6579b11e authored by Lukas Böhm's avatar Lukas Böhm
Browse files

first experiments with docker

parent 84dcd6f8
FROM python:3.8-alpine
WORKDIR /home/chiefsend
COPY ./requirements.txt ./requirements.txt
RUN pip install -r requirements.txt
RUN pip install gunicorn
# copy actual app
COPY app app
COPY chiefsend.py chiefsend.py
COPY start.sh start.sh
COPY init_db.py init_db.py
COPY home.db home.db
RUN chmod +x start.sh
ENV FLASK_APP chiefsend.py
EXPOSE 5000
ENTRYPOINT gunicorn -b :5000 --access-logfile - --error-logfile - chiefsend:app
\ No newline at end of file
# ChiefSend
Eine Tolle Webapp zum Austausch von Dateien
`docker build -t chiefsend:latest .`
`docker run --name chiefsend-test -d -p 8000:5000 --rm chiefsend:latest`
\ No newline at end of file
......@@ -2,10 +2,12 @@ import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
app = Flask(__name__)
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY') or 'jonas ist ein kek'
app.config['MEDIA_LOCATION'] = os.getenv('MEDIA_LOCATION') or 'C:/Users/Lukas/Documents/chiefsend/media'
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URI') or 'sqlite:///C:/Users/Lukas/Documents/chiefsend/home.db'
app.config['MEDIA_LOCATION'] = os.getenv('MEDIA_LOCATION') or os.path.join(basedir, 'media')
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URI') or 'sqlite:///' + os.path.join(basedir, 'home.db')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['MAX_MEDIA_SIZE'] = 1000 * 1024 * 1024 # 1000 MB
......
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import os
basedir = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)
app.config['SECRET_KEY'] = 'kekw'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///C:/Users/Lukas/Documents/chiefsend/home.db'
app.config['SQLALCHEMY_DATABASE_URI'] = os.path.join('basedir', 'home.db')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment