Skip to content
Snippets Groups Projects
Commit 2c15b2a4 authored by sheepmax's avatar sheepmax
Browse files

Added docker deployment setup, fixed bugs with directory listing parsing

parent b99aee03
No related branches found
No related tags found
2 merge requests!37Publish current website,!23Build and deploy with Docker
Pipeline #204748 passed
FROM python:3.11-slim-bullseye
WORKDIR /book
RUN apt-get update && apt-get -y install git
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
CMD ["./docker.sh"]
......@@ -311,9 +311,9 @@ function override_pyodide_lookup(fs, server_path) {
continue;
}
// Find alls all the rows in the html with class="display-name" and a file with a .py extension in the text
// Find alls all the links with .py files in the directory listing
// We cannot use DOMParser here since it's running inside a web worker: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API
const regex = /class=\"display-name\".*?\>\<.*?\>(.*?\.py)\<.*?\>/g;
const regex = /\<a href=\"(.*?\.py)\"\>(.*?\.py)\<.*?\>/g;
regex.lastIndex = 0;
for (const match of request.response.matchAll(regex)) {
......
......@@ -31,6 +31,6 @@ fi
# 7. cp: finally copies all files from the /book folder to /book/_build/html
find book/ -exec test -f {} \; -print | grep -v "^book/_.*\|.*\.\(md\|ipynb\)\|thebe_lite" | cut -c 6- | xargs -i sh -c 'echo "book/_build/html/{}" | grep -o "^.*/" | xargs -d "\n" mkdir -p; cp book/"{}" book/_build/html/"{}"'
# Serves the files on port 8000, localhost (127.0.0.1:8000)
# Serves the files on port 8000
$python_command -m http.server 8000 --directory book/_build/html &
#!/bin/sh
docker compose down
docker compose up -d
docker logs -f mude-book
services:
web:
container_name: mude-book
build: .
ports:
- "8000:8000"
volumes:
- type: bind
source: ./
target: /book
stdin_open: true
tty: true
#!/bin/sh
./build-lite.sh
bash
#!/bin/sh
docker compose down
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment