diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..1195bf4ff24ed49a953e93c248f082593bd8a771 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +__pycache__ +apicache-py3 +throttle.ctrl \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..08ee85f7f2c3a31dd36ed560a8663c2a155dc58b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.11-bullseye +WORKDIR /app +COPY requirements.txt /app/ +RUN pip install --no-cache-dir -r requirements.txt +# Install git +RUN apt-get update && apt-get install -y git +# Install wiktextract +RUN git clone https://github.com/tatuylonen/wiktextract.git && \ + cd wiktextract && \ + git checkout 205c4a2d88c27113f0117e0095f466605976af81 && \ + python -m pip install --use-pep517 . +# Uninstall git, remove temporary files and package lists +RUN apt-get purge -y git && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* +COPY /src/. ./src/ +EXPOSE 80 +# Set Flask environment variables +ENV FLASK_APP=/src/app.py +CMD ["flask", "run", "--debug"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8736c2e6765f9b696624ce4914fd0e5a39857350 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,17 @@ +version: '3' +services: + web: + build: + context: . + network: host + dockerfile: Dockerfile + environment: + FLASK_DEBUG: "on" + FLASK_APP: ./src/app.py + ports: + - "5000:80" + x-develop: + watch: + - action: sync + path: ./src + target: /src/ \ No newline at end of file