Skip to content

Commit ebb9339

Browse files
authored
chore(docker): Add Compose file and reformat README (#18)
* Add Compose file and reformat README * Set `network_mode` to `host` and remove `ports` This way we don't have to change port number in two different ways when using docker compose.
1 parent b27aab4 commit ebb9339

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

README.md

+25-7
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,53 @@
11
# ssh-web-console
2+
23
you can connect to your linux machine by ssh in your browser.
34

45
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/genshen/ssh-web-console?logo=docker&sort=date)
56
![Docker Image Version (latest semver)](https://img.shields.io/docker/v/genshen/ssh-web-console?sort=semver&logo=docker)
67
![Docker Pulls](https://img.shields.io/docker/pulls/genshen/ssh-web-console?logo=docker)
78

89
## Quick start
10+
911
```bash
1012
$ docker pull genshen/ssh-web-console:latest
1113
# docker build --build-arg GOMODULE=on -t genshen/ssh-web-console . # or build docker image on your own machine
1214
$ docker run -v ${PWD}/conf:/home/web/conf -p 2222:2222 --rm genshen/ssh-web-console
1315
```
1416

17+
or using Docker Compose:
18+
19+
```bash
20+
$ git clone https://github.com/genshen/ssh-web-console.git
21+
$ cd ssh-web-console
22+
$ docker-compose up -d
23+
```
24+
1525
Open your browser, visit `http://localhost:2222`. Enjoy it!
1626

17-
**note**: To run docker container, make sure config.yaml file is in directory ${PWD}/conf
27+
**NOTE**: To run docker container, make sure config.yaml file is in directory ${PWD}/conf
28+
1829
## Build & Run
19-
make sure you go version is not less than 1.11
2030

21-
### clone
31+
Make sure your Go version is 1.11 or later
32+
33+
### Clone
34+
2235
```bash
2336
git clone --recurse-submodules https://github.com/genshen/ssh-web-console.git
2437
cd ssh-web-console
2538
```
2639

27-
### build frontend
40+
### Build frontend
41+
2842
```bash
2943
cd web
3044
yarn install
3145
yarn build
3246
cd ../
3347
```
3448

35-
### build go
49+
### Build go
50+
3651
```bash
3752
go get github.com/rakyll/statik
3853
statik --src=web/build # use statik tool to convert files in 'web/build' dir to go code, and compile into binary.
@@ -41,12 +56,15 @@ go build
4156
```
4257

4358
## Run
59+
4460
run: `./ssh-web-console`, and than you can enjoy it in your browser by visiting `http://localhost:2222`.
4561

4662
## Screenshots
63+
4764
![](./Screenshots/shot2.png)
4865
![](./Screenshots/shot3.png)
4966
![](./Screenshots/shot4.png)
5067

51-
# Related Works
52-
https://github.com/shibingli/webconsole
68+
## Related Works
69+
70+
- [shibingli/webconsole](https://github.com/shibingli/webconsole)

docker-compose.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: "3.8"
2+
services:
3+
ssh-web-console:
4+
image: genshen/ssh-web-console:latest
5+
restart: unless-stopped
6+
volumes:
7+
- "./conf:/home/web/conf"
8+
network_mode: host

0 commit comments

Comments
 (0)