Skip to content

Commit 28ea143

Browse files
committed
add docker run launch instructions and update TODO
1 parent 61c289b commit 28ea143

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ocserv-docker/
3838
```bash
3939
apt-get update && apt-get upgrade -y
4040
curl -sSL https://get.docker.com | sh
41-
````
41+
```
4242

4343
### 2. Clone the Repository
4444

@@ -102,6 +102,8 @@ Adjust ports, volumes, or container settings if needed.
102102

103103
## 🚀 Running the Container
104104

105+
### Using Docker Compose
106+
105107
Start the VPN server:
106108

107109
```bash
@@ -114,12 +116,31 @@ View container logs:
114116
docker compose logs -f ocserv
115117
```
116118

119+
### Without Docker Compose
120+
121+
You can also run the container directly with `docker run`:
122+
123+
```bash
124+
docker run -d \
125+
--name ocserv \
126+
--restart unless-stopped \
127+
--cap-add=NET_ADMIN \
128+
--device /dev/net/tun:/dev/net/tun \
129+
--sysctl net.ipv4.ip_forward=1 \
130+
-p 443:443/tcp \
131+
-p 443:443/udp \
132+
--env-file .env \
133+
-v $(pwd)/config:/etc/ocserv \
134+
--security-opt no-new-privileges \
135+
ghcr.io/gifi71/ocserv-docker:latest
136+
```
137+
117138
---
118139

119140
## 🧱 TODO
120141

121-
- [X] Implement a multi-stage Docker build to reduce image size (`430MB` -> `113MB`)
122-
- [ ] Publish image to Docker Hub
142+
- [x] Implement a multi-stage Docker build to reduce image size (`430MB` -> `113MB`)
143+
- [x] Publish image to GitHub Container Registry (`ghcr.io/gifi71/ocserv-docker`)
123144

124145
---
125146

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
23
services:
34
ocserv:
45
image: ghcr.io/gifi71/ocserv-docker:latest

0 commit comments

Comments
 (0)