docker und requirements
This commit is contained in:
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM python:3.8-slim-buster as builder
|
||||
RUN python -m venv /opt/venv
|
||||
RUN apt-get update && apt-get install -y build-essential
|
||||
COPY requirements.txt .
|
||||
RUN pip install uwsgi
|
||||
RUN pip install -r requirements.txt
|
||||
FROM python:3.8-slim-buster
|
||||
COPY --from=builder /opt/venv /opt/venv
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
WORKDIR /srv/
|
||||
COPY simple_sample .
|
||||
COPY run.py .
|
||||
COPY config.cfg .
|
||||
@@ -1,6 +1,6 @@
|
||||
flask
|
||||
Frozen-Flask
|
||||
config
|
||||
uwsgi
|
||||
gevent
|
||||
https://github.com/andreassteph/flatpages_index/archive/master.zip
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ app.config.from_object(__name__)
|
||||
app.logger.setLevel(logging.DEBUG)
|
||||
|
||||
flatpages = FlatPagesIndex(app)
|
||||
flatpages_index.Links.endpoint="stuff.post"
|
||||
flatpages_index.Links.endpoint="stuff.page"
|
||||
flatpages_index.Links.url=(lambda s,x: url_for(s.endpoint, name=x))
|
||||
#flatpages_index.Links.image_url=(lambda s,x: url_for('stuff.page', name=x))
|
||||
flatpages_index.Links.file_url=(lambda s,x: url_for('stuff.page', name=x))
|
||||
|
||||
68
simple_sample/templates/page_plain.html
Normal file
68
simple_sample/templates/page_plain.html
Normal file
@@ -0,0 +1,68 @@
|
||||
{# -*-jinja2-*- #}
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{{post.title}}</h1>
|
||||
{{post.date}}
|
||||
{% if post.links["subindexpages"] | length > 0 %}
|
||||
<hr/>
|
||||
<b id="up_head"> Unterseiten: </b>
|
||||
<ul class="nav flex-column flex-sm-row " labeledby="up_head">
|
||||
{% for d in post.links["subindexpages"] %}
|
||||
<li class="nav-item">
|
||||
<a href="{{d.url}}" class="nav-link">
|
||||
<h6> {{d.title}} <small class="text-muted">{{d.desc}} </small> </h6>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{{ post.html|safe }}
|
||||
|
||||
|
||||
{% if post.links.subpages |length > 0 %}
|
||||
hi
|
||||
<ul class="nav flex-column flex-sm-row" labeledby="inf_head">
|
||||
{% for d in post.links.subpages %}
|
||||
<li class="nav-item">
|
||||
<a href="{{d.url}}" class="nav-link text-info">
|
||||
<h6> {{d.title}} <small class="text-muted">{{d.desc}} </small>
|
||||
</h6>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if post.links["files"] |length > 0 %}
|
||||
|
||||
<hr/>
|
||||
|
||||
<b id="inf_head">Files:</b>
|
||||
<ul>
|
||||
{% for d in post.links.files %}
|
||||
<li>
|
||||
<a href="{{d.url}}">{{d.title}} </a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if post.links["images"] |length > 0 %}
|
||||
|
||||
<hr/>
|
||||
|
||||
<b id="inf_head">Images:</b>
|
||||
<ul>
|
||||
{% for d in post.links.images %}
|
||||
<li>
|
||||
<a href="{{d.url}}">{{d.title}} </a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
67
simple_sample/templates/title.html
Normal file
67
simple_sample/templates/title.html
Normal file
@@ -0,0 +1,67 @@
|
||||
{# -*-jinja2-*- #}
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{{post.title}}</h1>
|
||||
{{post.date}}
|
||||
{% if post.links["subindexpages"] | length > 0 %}
|
||||
<hr/>
|
||||
<b id="up_head"> Unterseiten: </b>
|
||||
<ul class="nav flex-column flex-sm-row " labeledby="up_head">
|
||||
{% for d in post.links["subindexpages"] %}
|
||||
<li class="nav-item">
|
||||
<a href="{{d.url}}" class="nav-link">
|
||||
<h6> {{d.title}} <small class="text-muted">{{d.desc}} </small> </h6>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{{ post.html|safe }}
|
||||
|
||||
|
||||
{% if post.links["subpages"] |length > 0 %}
|
||||
<ul class="nav flex-column flex-sm-row" labeledby="inf_head">
|
||||
{% for d in post.sub_pages %}
|
||||
<li class="nav-item">
|
||||
<a href="{{d.url}}" class="nav-link text-info">
|
||||
<h6> {{d.title}} <small class="text-muted">{{d.desc}} </small>
|
||||
</h6>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if post.links["files"] |length > 0 %}
|
||||
|
||||
<hr/>
|
||||
|
||||
<b id="inf_head">Files:</b>
|
||||
<ul>
|
||||
{% for d in post.links.files %}
|
||||
<li>
|
||||
<a href="{{d.url}}">{{d.title}} </a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if post.links["images"] |length > 0 %}
|
||||
|
||||
<hr/>
|
||||
|
||||
<b id="inf_head">Images:</b>
|
||||
<ul>
|
||||
{% for d in post.links.images %}
|
||||
<li>
|
||||
<a href="{{d.url}}">{{d.title}} </a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user