https://github.com/andarius/nginx-upload
Nginx alpine docker with upload module
https://github.com/andarius/nginx-upload
alpine-nginx nginx-docker
Last synced: 9 months ago
JSON representation
Nginx alpine docker with upload module
- Host: GitHub
- URL: https://github.com/andarius/nginx-upload
- Owner: Andarius
- License: mit
- Created: 2019-03-05T13:32:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T06:00:39.000Z (over 2 years ago)
- Last Synced: 2023-07-05T07:23:42.935Z (over 2 years ago)
- Topics: alpine-nginx, nginx-docker
- Language: Dockerfile
- Size: 15.6 KB
- Stars: 25
- Watchers: 3
- Forks: 22
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Upload File with Nginx upload module
- ENV:
- nginx-1.22.1-alpine
- nginx-upload-module-2.3.0
# Docker Image
Image available @https://hub.docker.com/repository/docker/andarius/nginx-upload
# Run
- Build the image:
```sh
docker build -t nginx-upload:dev . -f Dockerfile
```
- Start the nginx server:
```sh
docker run --rm \
-p 5050:5050 \
-v "$(pwd)/nginx.conf:/etc/nginx/nginx.conf:ro" \
--name nginx-upload nginx-upload:dev
```
# Test
- To upload a file, run:
```sh
curl 0.0.0.0:5050/upload -F "fileobj=@$(pwd)/README.md" -F "name=readme.md"
```
You can then see the uploaded file with:
```sh
docker exec nginx-upload ls -alh /tmp/nginx_upload
```
or with curl:
```sh
curl 0.0.0.0:5050/0000000001
```