ttyd / Dockerfile
aripbae's picture
Update Dockerfile
ab0e375 verified
FROM node:lts-alpine
USER root
RUN apk add --no-cache nginx ttyd bash curl git \
cairo pango libjpeg-turbo giflib librsvg jq
RUN curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
RUN echo "export PS1='\[\033[01;32m\]root@akkun\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> /root/.bashrc && \
echo "export PS1='\[\033[01;32m\]root@akkun\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> /etc/profile
RUN echo 'events {} http { \
server { \
listen 7860; \
location / { \
proxy_pass http://127.0.0.1:8080; \
} \
location /term/ { \
proxy_pass http://127.0.0.1:7681; \
proxy_http_version 1.1; \
proxy_set_header Upgrade $http_upgrade; \
proxy_set_header Connection "upgrade"; \
proxy_set_header X-Real-IP $remote_addr; \
} \
} \
}' > /etc/nginx/nginx.conf
WORKDIR /root
RUN mkdir -p /etc/nginx/logs /run/nginx
CMD filebrowser -p 8080 -r /root --noauth -d /tmp/filebrowser.db & \
ttyd -p 7681 -W -b /term bash & \
nginx -c /etc/nginx/nginx.conf -g 'daemon off;'