Use https as default scheme, run behind gunicorn in container
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e231c63332
commit
557ae95406
4 changed files with 5 additions and 1 deletions
|
@ -7,3 +7,4 @@ SNIP_DATABASE_TRACK_MODIFICATIONS=False
|
|||
SNIP_FLASK_SECRET=secret
|
||||
SNIP_FLASK_ENVIRONMENT=development
|
||||
SNIP_FLASK_DEBUG=True
|
||||
SNIP_FLASK_PREFERRED_URL_SCHEME=http
|
||||
|
|
|
@ -9,10 +9,11 @@ COPY . /app
|
|||
WORKDIR /app
|
||||
|
||||
RUN pipenv install
|
||||
RUN pipenv install gunicorn
|
||||
|
||||
ENV SNIP_DATABASE="sqlite"
|
||||
ENV SNIP_DATABASE_URI="sqlite:////data/snip.db"
|
||||
ENV SNIP_FLASK_HOST="0.0.0.0"
|
||||
|
||||
EXPOSE 5000
|
||||
CMD ["pipenv", "run", "python", "-m", "snip"]
|
||||
CMD ["pipenv", "run", "gunicorn", "-b0.0.0.0:5000", "snip:app"]
|
||||
|
|
|
@ -24,6 +24,7 @@ app = Flask(__name__)
|
|||
|
||||
app.config.update(
|
||||
SECRET_KEY = snip_config.SNIP_FLASK_SECRET.get_secret_value(),
|
||||
PREFERRED_URL_SCHEME = snip_config.SNIP_FLASK_PREFERRED_URL_SCHEME,
|
||||
SQLALCHEMY_DATABASE_URI = snip_config.SNIP_DATABASE_URI,
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = snip_config.SNIP_DATABASE_TRACK_MODIFICATION)
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ class SnipConfig(BaseModel):
|
|||
SNIP_FLASK_ENVIRONMENT: Literal['development', 'production'] = 'production'
|
||||
SNIP_FLASK_DEBUG: bool = False
|
||||
SNIP_FLASK_SKIP_DOTENV: int = 1
|
||||
SNIP_FLASK_PREFERRED_URL_SCHEME: Literal['http', 'https'] = 'https'
|
||||
# Non-standard flask settings
|
||||
SNIP_FLASK_HOST: str = "localhost"
|
||||
SNIP_FLASK_PORT: int = 5000
|
||||
|
|
Loading…
Add table
Reference in a new issue