Skip to content

Add minio container to mock s3 locally #597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ information on how to setup this environment.

### Docker-Compose

The services started by Docker-Compose are defined in [docker-compose.yml].
Three services are defined:

| name | access | credentials | description |
|------|-----------------------|----------------------------|----------------------------------------|
| web | http://localhost:3000 | N/A | A container running the docs.rs binary |
| db | / | N/A | Postgres database used by web |
| s3 | http://localhost:9000 | `cratesfyi` - `secret_key` | Minio (simulates AWS S3) used by web |

[docker-compose.yml]: ./docker-compose.yml

#### Rebuilding Containers

To rebuild the site, run `docker-compose build`.
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
build: .
depends_on:
- db
- s3
ports:
- "3000:3000"
volumes:
Expand All @@ -13,6 +14,9 @@ services:
environment:
CRATESFYI_RUSTWIDE_WORKSPACE: /opt/docsrs/rustwide
CRATESFYI_DATABASE_URL: postgresql://cratesfyi:password@db
S3_ENDPOINT: http://s3:9000
AWS_ACCESS_KEY_ID: cratesfyi
AWS_SECRET_ACCESS_KEY: secret_key
env_file:
- .env
db:
Expand All @@ -22,6 +26,21 @@ services:
environment:
POSTGRES_USER: cratesfyi
POSTGRES_PASSWORD: password
s3:
image: minio/minio
entrypoint: >
/bin/sh -c "
mkdir /data/rust-docs-rs;
minio server /data;
"
ports:
- "9000:9000"
volumes:
- minio-data:/data
environment:
MINIO_ACCESS_KEY: cratesfyi
MINIO_SECRET_KEY: secret_key
volumes:
postgres-data: {}
minio-data: {}
cratesio-index: {}