diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7da7107 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +# Ignore everything +** + +# ... except for dependencies and source +!Pipfile +!Pipfile.lock + +# these will need removed once in package setup +!assets/ +!pages/ +!templates/ +!fastic.py +!config.py +!runtime.txt +!.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..00452ea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM python:3.7-slim + +ENV LANG C.UTF-8 +ENV LC_ALL C.UTF-8 +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONFAULTHANDLER 1 + +COPY ./Pipfile /app/Pipfile +COPY ./Pipfile.lock /app/Pipfile.lock + +WORKDIR /app + +RUN apt-get update && apt-get install -y --no-install-recommends gcc + +RUN pip install pipenv +RUN pipenv install --dev + +COPY . /app + +# Run fastic +ENTRYPOINT ["pipenv", "run"] + +CMD ["python", "fastic.py"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a8b51e4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3' +services: + web: + build: . + ports: + - "5000:5000" + volumes: + - .:/app + environment: + FLASK_ENV: development + command: pipenv run python fastic.py diff --git a/fastic.py b/fastic.py index b65e771..4c9b0bf 100644 --- a/fastic.py +++ b/fastic.py @@ -102,7 +102,7 @@ def run_dev(): server.watch('./templates', build_pages) server.watch('./assets/sass', build_styles) server.watch('./assets/js', build_js) - server.serve(root='build', port=5555) + server.serve(root='build', host="0.0.0.0", port=5000) if __name__ == '__main__': diff --git a/templates/base.html b/templates/base.html index 209d626..ab92506 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,7 +3,7 @@ - Fastic + Fastic - python static site generator