Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
garethflowers authored Dec 6, 2024
2 parents 89ce200 + 2bd2690 commit 592a2ad
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4
- name: Prepare
id: prep
uses: docker/metadata-action@v5.5.1
uses: docker/metadata-action@v5.6.1
with:
images: |
${{ github.repository_owner }}/ftp-server
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.20.3
FROM alpine:3.21.0
ENV FTP_USER=foo \
FTP_PASS=bar \
GID=1000 \
UID=1000
UID=1000 \
PUBLIC_IP=0.0.0.0

RUN apk add --no-cache --update \
vsftpd==3.0.5-r2
Expand Down
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ docker run \
--detach \
--env FTP_PASS=123 \
--env FTP_USER=user \
--env PUBLIC_IP=192.168.0.1 \
--name my-ftp-server \
--publish 20-21:20-21/tcp \
--publish 40000-40009:40000-40009/tcp \
Expand All @@ -28,19 +29,40 @@ docker run \

```yml
services:
ftp-server:
container_name: my-ftp-server
environment:
- FTP_PASS=123
- FTP_USER=user
image: garethflowers/ftp-server
ports:
- '20-21:20-21/tcp'
- '40000-40009:40000-40009/tcp' # Only needed for passive mode
volumes:
- '/data:/home/user'
ftp-server:
container_name: my-ftp-server
environment:
- PUBLIC_IP=192.168.0.1
- FTP_PASS=123
- FTP_USER=user
image: garethflowers/ftp-server
ports:
- "20-21:20-21/tcp"
- "40000-40009:40000-40009/tcp" # For passive mode
volumes:
- "/data:/home/user"
```
## Configuration
### Ports
| Port | Required? | Description | Config |
| -------------- | --------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| 21 | Required | The default port that FTP listens on. | [listen_port](https://security.appspot.com/vsftpd/vsftpd_conf.html) |
| 20 | Required | The default port for PORT connections to originate. | [ftp_data_port](https://security.appspot.com/vsftpd/vsftpd_conf.html) |
| 40000<br>40009 | Optional | The min and max ports to use for PASV connections to originate. | [pasv_min_port](https://security.appspot.com/vsftpd/vsftpd_conf.html)<br>[pasv_max_port](https://security.appspot.com/vsftpd/vsftpd_conf.html) |
### Environment Variables
| Variable | Default Value | Description |
| ----------- | ------------- | ------------------------------------------------- |
| `FTP_PASS` | `bar` | The FTP password |
| `FTP_USER` | `foo` | The FTP username |
| `UID` | `1000` | User ID for the `$FTP_USER` user |
| `GID` | `1000` | Group ID for the `$FTP_USER` user |
| `PUBLIC_IP` | `0.0.0.0` | Public IP address to use for Passive connections. |

## License

- This image is released under the
Expand Down
2 changes: 2 additions & 0 deletions src/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ mkdir -p /home/$FTP_USER
chown -R $FTP_USER:$FTP_USER /home/$FTP_USER
echo "$FTP_USER:$FTP_PASS" | /usr/sbin/chpasswd

sed -i -r "s/0.0.0.0/$PUBLIC_IP/g" /etc/vsftpd.conf

touch /var/log/vsftpd.log
tail -f /var/log/vsftpd.log | tee /dev/stdout &
touch /var/log/xferlog
Expand Down

0 comments on commit 592a2ad

Please sign in to comment.