Merge pull request #2 from jdejaegh/Dockerfile

Add dockerfile
This commit is contained in:
kthys 2020-11-28 23:25:23 +01:00 committed by GitHub
commit f2a253886f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 3 deletions

17
Dockerfile Normal file
View file

@ -0,0 +1,17 @@
FROM python:3.6.12-alpine3.12
WORKDIR /usr/src/ics
# Copy the actual folder and install dependencies
COPY . ./
RUN pip3 install -r requirements.txt
# Mount the config volume
RUN mkdir /usr/src/ics/app/config
VOLUME [ "/usr/src/ics/app/config" ]
EXPOSE 8088
CMD ["python3", "./app/server.py"]

View file

@ -7,6 +7,22 @@ ICS Fusion is written in Python and using `Flask` to provide the HTTP endpoint.
Launch the `app/server.py` file to start the application. Launch the `app/server.py` file to start the application.
### Building the image
ICS Fusion can be built as a Docker image. To do so, type :
`docker build --tag ics-fusion:1.0 .`
in the main folder of Fusion ICS.
### Running the container
To run the container, type:
`docker run --publish PORT:8088 --detach --name ics --volume DIRECTORY:/usr/src/ics/app/config ics-fusion:1.0`
Where:
* `PORT` is the port you want to expose on your host machine.
* `DIRECTORY` is the path to your config directory.
## Configuration ## Configuration
To create a new feed in the application, create a file with the `.json` extension in the `app/config` folder. The name of the configuration file will be used to create a new endpoint to serve the feed. To create a new feed in the application, create a file with the `.json` extension in the `app/config` folder. The name of the configuration file will be used to create a new endpoint to serve the feed.

View file

@ -1,7 +1,7 @@
from flask import Flask, make_response from flask import Flask, make_response
from app.tools.caching import CacheThread from tools.caching import CacheThread
from app.tools.tools import * from tools.tools import *
app = Flask(__name__) app = Flask(__name__)

View file

@ -77,7 +77,7 @@ from typing import List
from ics import Calendar from ics import Calendar
from pathvalidate import sanitize_filename from pathvalidate import sanitize_filename
from app.tools.caching import load_cal from tools.caching import load_cal
def filtering(cal: Calendar, filters: dict, field_name: str) -> Calendar: def filtering(cal: Calendar, filters: dict, field_name: str) -> Calendar: