Skip to content

Commit

Permalink
Add more illustrations about using the local disk as the backend (#62)
Browse files Browse the repository at this point in the history
* add docker-compose.local.yml

add an example yml file for using local storage as a backend

Signed-off-by: Hongyu Li <543306408@qq.com>

* add the illustration of using local disk as backend

Signed-off-by: Hongyu Li <543306408@qq.com>

---------

Signed-off-by: Hongyu Li <543306408@qq.com>
  • Loading branch information
Richardhongyu committed Oct 19, 2023
1 parent 62f9007 commit 3e72918
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ cargo run -- \
--bucket foobar
```

If you just need to use the local disk as the backend, use the following bash.

```bash
# Change this to the output of `openssl rand -hex 32`.
export RUDOLFS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


cargo run -- --port 8080 local --path=/data
```

**Note**: Always use a different S3 bucket, cache directory, and encryption key
than what you use in your production environment.

Expand Down Expand Up @@ -119,6 +129,12 @@ To run in a production environment, it is easiest to use `docker-compose`:

```bash
docker-compose up -d

# use minio yml
docker-compose -f ./docker-compose.minio.yml up -d

# use local disk yml
docker-compose -f ./docker-compose.local.yml up -d
```

3. **[Optional]**: It is best to use nginx as a reverse proxy for this server.
Expand Down
48 changes: 48 additions & 0 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copy this file to another location and modify as necessary.
version: '3'
services:
app:
image: jasonwhite0/rudolfs:latest
#build:
# context: .
# dockerfile: Dockerfile
ports:
- "8081:8080"
volumes:
- data:/data
restart: always
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION
- LFS_ENCRYPTION_KEY
- LFS_S3_BUCKET
- LFS_MAX_CACHE_SIZE
entrypoint:
- /tini
- --
- /rudolfs
- --cache-dir
- /data
- --key
- ${LFS_ENCRYPTION_KEY}
- --port
- "8080"
- local
- --path=/data

# A real production server should use nginx. How to configure this depends on
# your needs. Use your Google-search skills to configure this correctly.
#
# nginx:
# image: nginx:stable
# ports:
# - 80:80
# - 443:443
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf
# - ./nginx/errors.log:/etc/nginx/errors.log


volumes:
data:

0 comments on commit 3e72918

Please sign in to comment.