Skip to content

Commit 6699ed4

Browse files
committed
support dockerfile
1 parent 00a8ea2 commit 6699ed4

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang
2+
WORKDIR /app
3+
COPY . .
4+
WORKDIR /app/client
5+
RUN go build -o app .
6+
WORKDIR /app/server
7+
RUN go build -o app .
8+
WORKDIR /app
9+
RUN chmod +x start.sh
10+
EXPOSE 80 1180
11+
CMD ["/app/start.sh"]

README.MD

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ A lightweight proxy tool based on the WebSocket protocol
88
```shell
99
git clone github.com/golangboy/wsproxy
1010
```
11-
1211
## Client
1312
```shell
1413
cd client
@@ -38,7 +37,20 @@ Usage of ./server:
3837
listen address (default ":80")
3938

4039
```
41-
40+
# 🐳 Docker
41+
```shell
42+
git clone github.com/golangboy/wsproxy
43+
cd wsproxy
44+
docker build -t wsproxy .
45+
```
46+
#### client
47+
```shell
48+
docker run -itd -p 1180:1180 -e ws=your_server:80 wsproxy
49+
```
50+
#### server
51+
```shell
52+
docker run -itd -p 80:80 wsproxy
53+
```
4254
# 🧑‍💻 How to use
4355
## On server
4456
```shell

start.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
if [ -z $ws ]; then
3+
echo "Starting server"
4+
/app/server/app
5+
else
6+
echo "Starting client"
7+
/app/client/app -ws=$ws
8+
fi

0 commit comments

Comments
 (0)