How to use s3 locally

 

This tutorial is about running s3 on local system  to avoid cost and no need to buy aws account service also fast your development.

  Prerequisite

    - Docker

    - LocalStack image

I am not going to write this deeply just let you know some steps.

If you have not docker install the docker , i will share a docker compose file save this file with docker-compose.yml in your system open this file in vscode. or you can directly compose or build this file using docker command, to make it simple i just using vscode.

Open file in vscode and write click on source code then click on option  compose file, this build and compose your file. once your file execute the service will run on localhost:5002  to use this internally in docker use this http://host.docker.internal:5002

To learn more about it check out other tutorial and here is link how to use dynamodb locally you can follow up to see more steps using that. 

how to use dynamodb locally

how to explore volume and file system in Docker

here is file source code docker-compose.yml

version'3.7'
services:
  localstack-s3:
    imagelocalstack/localstack:latest
    container_namelocalstack-s3
    environment:
     - SERVICES=s3:5002
     - DEFAULT_REGION=us-east-1
     - DATA_DIR=/tmp/localstack/data
    ports:
     - "5002:5002"
    volumes:
      - localstack-data:/tmp/localstack
volumes:
  localstack-data:
    namelocalstack-data

Comments