oulh commited on
Commit
c373af3
1 Parent(s): ac30ddc

Add application file

Browse files
Files changed (3) hide show
  1. Dockerfile +28 -0
  2. nginx.conf +41 -0
  3. txt.txt +1 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:20.04
2
+ EXPOSE 80 8080
3
+ # set password
4
+ RUN echo $UPASSWD | chpasswd
5
+ # init
6
+ RUN apt update
7
+ RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && \
8
+ yes | unminimize && \
9
+ apt install -y openssh-server bash-completion git curl vim
10
+ # nginx
11
+ RUN \
12
+ sudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring && \
13
+ curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
14
+ | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null && \
15
+ echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
16
+ http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
17
+ | sudo tee /etc/apt/sources.list.d/nginx.list && \
18
+ apt update && apt install -y nginx
19
+
20
+ COPY ./nginx.conf /etc/nginx/
21
+
22
+ # SSH
23
+ RUN cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak && \
24
+ echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
25
+ # echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
26
+
27
+ CMD service nginx start && service ssh start
28
+
nginx.conf ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ user nginx;
3
+ worker_processes auto;
4
+
5
+ error_log /var/log/nginx/error.log notice;
6
+ pid /var/run/nginx.pid;
7
+
8
+
9
+ events {
10
+ worker_connections 1024;
11
+ }
12
+
13
+ stream {
14
+ upstream ssh {
15
+ server 127.0.0.1:22;
16
+ }
17
+ server {
18
+ listen 8080;
19
+ proxy_pass ssh;
20
+ }
21
+ }
22
+
23
+ http {
24
+ include /etc/nginx/mime.types;
25
+ default_type application/octet-stream;
26
+
27
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
28
+ '$status $body_bytes_sent "$http_referer" '
29
+ '"$http_user_agent" "$http_x_forwarded_for"';
30
+
31
+ access_log /var/log/nginx/access.log main;
32
+
33
+ sendfile on;
34
+ #tcp_nopush on;
35
+
36
+ keepalive_timeout 65;
37
+
38
+ #gzip on;
39
+
40
+ include /etc/nginx/conf.d/*.conf;
41
+ }
txt.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ https://wusiyu.me/full-ubuntu-devbox-in-docker/