ยง2023-12-16
- Dockerfile
FROM debian:bookworm
USER root
RUN echo 'root:b23258585' | chpasswd
RUN useradd -m -d /home/alexlai -s /bin/bash -G sudo -u 1026 alexlai && \
echo 'alexlai:alex1765' | chpasswd
#
RUN apt update && apt -y upgrade && \
apt install -y fonts-noto-cjk caddy
#
USER alexlai
RUN mkdir /home/alexlai/yushei-caddy-markdown
#
USER root
WORKDIR /home/alexlai/yushei-caddy-markdown
#
EXPOSE 80
EXPOSE 443
EXPOSE 443/udp
EXPOSE 2019
# Make sure it runs and reports its version
RUN ["caddy", "version"]
# CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
CMD ["caddy", "run"]
LABEL maintainer="alexlai@munetaka.me"
#
# Notes
#
# docker build --tag caddy:debian_bookworm (--no-cache) ./
# docker run -it caddy:debian_bookworm /bin/bash
# Testing
# docker run -d -p 42103:80 --name Debian_caddy caddy:debian_bookworm
# sudo docker run -d -p 42103:80 -v /volume2/YuSheiCaddyMarkdown/Caddyfile:/etc/caddy/Caddyfile -v /volume2/YuSheiCaddyMarkdown:/home/alexlai/yushei-caddy-markdown --name Debian_caddy caddy:debian_bookworm
# docker run -d -p 42103:80 --mount type=bind,source=/volume1/JupyterHub,target=/home/alexlai/JupyterHub --name jupyterhub jupyterhub:ubuntu_conda jupyterhub
# outside-port:inside-port
# docker run -d -p 42100:8000 --name jupyterhub jupyterhub:ubuntu_conda jupyterhub
#
# docker ps
# docker stop (NAMES)
# docker rm (NAMES)
#
curl 192.168.2.251:42019/load
-H "Content-Type: application/json"
-d @- << EOF
{
"apps": {
"http": {
"servers": {
"hello": {
"listen": [":80"],
"routes": [
{
"handle": [{
"handler": "static_response",
"body": "Hello, world!"
}]
}
]
}
}
}
}
}
EOF