Last active
June 29, 2024 09:31
-
-
Save sago35/79c8ea1f1b55202aa6c95d76f26325aa to your computer and use it in GitHub Desktop.
Dockerfile for vial-web
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:22.04 | |
RUN apt-get update && apt-get install -y tzdata | |
# timezone setting | |
ENV TZ=Asia/Tokyo | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
bash \ | |
xz-utils \ | |
bzip2 \ | |
wget \ | |
python3-openssl \ | |
build-essential libssl-dev zlib1g-dev \ | |
libbz2-dev libreadline-dev libsqlite3-dev curl \ | |
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev | |
RUN ln -s /usr/bin/python3 /usr/bin/python | |
WORKDIR /app | |
RUN git clone https://github.com/vial-kb/vial-web.git | |
WORKDIR /app/vial-web | |
RUN git clone https://github.com/vial-kb/vial-gui.git | |
#RUN git clone https://github.com/sago35/vial-gui.git && cd vial-gui && git checkout debug | |
RUN git clone https://github.com/vial-kb/via-keymap-precompiled.git | |
RUN chmod +x fetch-emsdk.sh fetch-deps.sh build-deps.sh | |
RUN ./fetch-emsdk.sh | |
RUN ./fetch-deps.sh | |
RUN ./build-deps.sh | |
WORKDIR /app/vial-web/src | |
RUN chmod +x build.sh | |
RUN ./build.sh | |
WORKDIR /app/vial-web/src/build | |
COPY server.py /app/vial-web/src/server.py | |
EXPOSE 8000 | |
CMD ["python", "../server.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from http.server import HTTPServer, SimpleHTTPRequestHandler, test | |
import sys | |
class CORSRequestHandler (SimpleHTTPRequestHandler): | |
def end_headers (self): | |
self.send_header('Access-Control-Allow-Origin', '*') | |
self.send_header('Cross-Origin-Embedder-Policy', 'require-corp') | |
self.send_header('Cross-Origin-Opener-Policy', 'same-origin') | |
SimpleHTTPRequestHandler.end_headers(self) | |
if __name__ == '__main__': | |
test(CORSRequestHandler, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
以下を実行すると USB のやり取りを Chrome 等の dev console から見ることができる。