Skip to content

Commit 306552a

Browse files
chore: Dockerfile and simple uwsgi config
1 parent a8c9575 commit 306552a

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

ical-simplejson-proxy/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.9-slim
2+
3+
RUN mkdir /app
4+
COPY ./requirements.txt /app/
5+
RUN apt-get update \
6+
&& apt-get -y install build-essential \
7+
&& cd /app \
8+
&& pip install -r requirements.txt \
9+
&& apt-get clean autoclean \
10+
&& apt-get autoremove --yes \
11+
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
12+
COPY ./app.py /app/
13+
COPY ./uwsgi.ini /app/
14+
15+
RUN adduser app --system --uid 1337
16+
USER app
17+
18+
WORKDIR /app
19+
20+
EXPOSE 5000
21+
CMD uwsgi /app/uwsgi.ini

ical-simplejson-proxy/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,7 @@ def _convert_ical_to_annotations(ical_data, tags):
124124
f'level=ERROR msg="decoding event failed" event_summary="{component.get("summary")}" event_dtstart="{component.get("dtstart")}" event_dtstamp="{component.get("dtstamp")}" event_dtend="{component.get("dtend")}"'
125125
)
126126
return ical_annotations
127+
128+
129+
if __name__ == "__main__":
130+
app.run(host="0.0.0.0", port=5000)

ical-simplejson-proxy/requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ Flask==2.2.2
22
Flask-Cors==3.0.10
33
requests==2.28.1
44
requests-file==1.5.1
5-
ics==0.7.2
5+
uWSGI==2.0.20
6+
icalendar==4.1.0
7+
cachetools==5.2.0

ical-simplejson-proxy/uwsgi.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[uwsgi]
2+
http = 0.0.0.0:5000
3+
wsgi-file = app.py
4+
callable = app
5+
master = true
6+
logformat = client_ip=%(addr) method=%(method) path=%(uri) status=%(status) size=%(size) response_ms=%(msecs) x_tags=%(var.HTTP_X_TAGS)

0 commit comments

Comments
 (0)