aripbae commited on
Commit
e1b0ef8
·
verified ·
1 Parent(s): 9493b13

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -29
Dockerfile CHANGED
@@ -1,44 +1,40 @@
1
- FROM zxdong262/electerm-web:latest
2
 
3
- USER root
 
 
 
 
 
4
 
5
- # Install Nginx, Nano, dan Findutils (buat nyari file)
6
- RUN apt-get update && \
7
- apt-get install -y nginx nano findutils && \
8
- rm -rf /var/lib/apt/lists/*
9
 
10
- RUN echo "export PS1='\[\033[01;32m\]root@akkun\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> /root/.bashrc
 
11
 
12
- RUN echo 'events {} \
13
- http { \
14
  server { \
15
  listen 7860; \
16
  location / { \
17
- proxy_pass http://127.0.0.1:5577; \
 
 
 
18
  proxy_http_version 1.1; \
19
  proxy_set_header Upgrade $http_upgrade; \
20
  proxy_set_header Connection "upgrade"; \
21
- proxy_set_header Host $host; \
22
- proxy_read_timeout 86400; \
23
  } \
24
  } \
25
  }' > /etc/nginx/nginx.conf
26
 
27
- RUN mkdir -p /run/nginx /var/log/nginx
28
-
29
- ENV HOST=0.0.0.0
30
- ENV PORT=5577
31
- ENV DB_PATH=/home/electerm/data
32
- ENV ENABLE_AUTH=0
33
-
34
- RUN mkdir -p /home/electerm/data
35
-
36
- EXPOSE 7860
37
-
38
- ENTRYPOINT []
39
 
40
- CMD nginx -c /etc/nginx/nginx.conf && \
41
- SCRIPT=$(find / -type f -name "run.sh" 2>/dev/null | head -n 1) && \
42
- echo "Found startup script at: $SCRIPT" && \
43
- cd $(dirname "$SCRIPT") && \
44
- bash "$SCRIPT"
 
1
+ FROM alpine:edge
2
 
3
+ RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
4
+ apk add --no-cache \
5
+ nginx ttyd bash curl unzip tmux micro neofetch font-noto \
6
+ python3 py3-pip npm
7
+ RUN curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
8
+ RUN ln -sf /usr/bin/python3 /usr/bin/python
9
 
10
+ RUN echo "set -g mouse on" > /root/.tmux.conf && \
11
+ echo "set -g status-position top" >> /root/.tmux.conf && \
12
+ echo "set -g base-index 1" >> /root/.tmux.conf && \
13
+ echo "set -g pane-base-index 1" >> /root/.tmux.conf
14
 
15
+ RUN mkdir -p /root/.config/micro && \
16
+ echo '{"mouse": true, "colorscheme": "simple"}' > /root/.config/micro/settings.json
17
 
18
+ RUN echo "export PS1='\[\033[01;32m\]root@akkun\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> /root/.bashrc
19
+ RUN echo 'events {} http { \
20
  server { \
21
  listen 7860; \
22
  location / { \
23
+ proxy_pass http://127.0.0.1:8080; \
24
+ } \
25
+ location /term/ { \
26
+ proxy_pass http://127.0.0.1:7681; \
27
  proxy_http_version 1.1; \
28
  proxy_set_header Upgrade $http_upgrade; \
29
  proxy_set_header Connection "upgrade"; \
30
+ proxy_set_header X-Real-IP $remote_addr; \
 
31
  } \
32
  } \
33
  }' > /etc/nginx/nginx.conf
34
 
35
+ WORKDIR /
36
+ RUN mkdir -p /etc/nginx/logs /run/nginx
 
 
 
 
 
 
 
 
 
 
37
 
38
+ CMD filebrowser -p 8080 -r / --noauth -d /tmp/filebrowser.db & \
39
+ ttyd -p 7681 -W -b /term tmux new -A -s main & \
40
+ nginx -c /etc/nginx/nginx.conf -g 'daemon off;'