From b246f3f97e4c695f73a09ffbcf08819c53f225ed Mon Sep 17 00:00:00 2001 From: Alexis Bollia Date: Thu, 20 Jun 2019 11:47:49 +0200 Subject: [PATCH] Add VagrantFile and update readme --- README.md | 35 ++++++++++++++++++++++++----------- Vagrantfile | 19 +++++++++++++++++++ 2 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 Vagrantfile diff --git a/README.md b/README.md index 9d52849..a6dea6f 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,28 @@ Docker image with latest version of S3 fake service ( https://github.com/jamhall ## Usage with Vagrant -Set the bucket name environment variable in your Vagrantfile. - -```ruby -config.vm.define "s3" do |s3| - s3.vm.provider "docker" do |d| - d.image = "jean553/docker-s3-server-dev" - d.env = { - "S3_BUCKET_NAME" => "MyBucketName", - } - end -end +Build the container + +``` +vagrant up +``` + +your s3 developpement server is running on http://127.0.0.1:5000. + +The Default Bucket Name is `development_bucket`. + +You can change port and bucketName in the VagrantFile, and simply reload your container. + +``` +vagrant reload +``` + + +If your client only supports signed requests, specify the credentials + ``` +{ + accessKeyId: "S3RVER", + secretAccessKey: "S3RVER", +} +``` \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..3789b7d --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,19 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby ts=2 sw=2 expandtab : + +PROJECT = "s3" +PROJECT_DIR = "/vagrant/s3" + +Vagrant.configure(2) do |config| + + + config.vm.define "s3" do |s3| + s3.vm.provider "docker" do |d| + d.image = "jean553/docker-s3-server-dev" + d.env = { + "S3_BUCKET_NAME" => "development_bucket", + } + end + s3.vm.network "forwarded_port", guest: 5000, host: 5000 + end +end