Code Monkey home page Code Monkey logo

docker-demo's Introduction

How to Dockerize a React App and Deploy in Elastic Beanstalk

Docker Configuartion Steps

1. Create file called "Dockerfile" and add the following lines, be sure to change version to a number i.e: 10.12.0 Use node -v to find version

FROM node:version
container .

WORKDIR /app

COPY . /app

RUN npm install

CMD npm start

EXPOSE 3000

2. Create .dockerignore file and add in the following lines

node_modules
npm-debug.log

Docker Build Steps

1. Build docker first

docker build -t docker-name .

2. Run docker to test.

docker run -p 8081:3000 professional-portfolio

Elastic Beanstalk Steps

1. Commit changes to git

git add .

git commit -m "Eb Deploy Settings"

git push

2. Initialize EB

eb init 

Select default -> Create new application -> Enter application name -> Setup ssh

3. Create EB Environment

eb create

Select default -> Select Name

4. Deploy EB

eb use environment name

eb deploy

5. Confirm EB is deployed

eb open

Author:

  1. Ryan LeBon
  2. AWS, Docker & React

docker-demo's People

Contributors

ryanlb777 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.