Code Monkey home page Code Monkey logo

aws-react-docker-ghactions's Introduction

Local Dev Setup:

  • Run npm i
  • Create .env file based off .env-template and fill out env vars.
  • Run npm start and node server.js simultaneously.

How to test docker setup:

  • Build docker image and run container:
  • docker build -t myapp . && docker run -p 80:80 -p 3030:3030 myapp
  • React app should now be at http://localhost
  • Server should accept requests at /dbtest route.

How to access docker logs:

  • Find container ID: docker ps
  • Open a shell session in the running container docker exec -it id /bin/sh
  • Navigate to logs folder and print: cd /var/log && cat node_server.log

How to clean up docker:

  • Stop container: docker stop 123abc456def
  • Remove all stopped containers: docker container prune
    • Or remove container by id: docker rm 123abc456def
  • Remove all hanging images: docker image prune

How I created the aws deployment for this project:

Following this guide: https://medium.com/@nwosuonyedikachi/deploying-a-react-app-to-aws-ecs-with-github-actions-5c74c1869800

  1. Create, setup, and run react site using npx create-react-app
  • npm i
  • npm start
  1. Create private repo on Elastic Container Registry (ECR) in AWS.
  • name: dev-portfolio-react
  1. Go to Elastic Container Service(ECS) and Create a Cluster
  • name: portfolioCluster
  1. Create new task definition
  1. Create an ECS service for the newly created ECS cluster
  • Set name = "DevPortfolioClusterService"
  • Select the task we created in previous step
  1. Create GH actions workflow yml
  2. Update the env: vars in the workflow.yml to contain the real values.
  3. Update the github repo secrets to include and.

aws-react-docker-ghactions's People

Contributors

martinbarker avatar

Watchers

 avatar  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.