An open API service indexing awesome lists of open source software.

https://github.com/leolanese/react-dockerizing-app

react-dockerizing-app
https://github.com/leolanese/react-dockerizing-app

docker docker-compose reactjs

Last synced: about 2 months ago
JSON representation

react-dockerizing-app

Awesome Lists containing this project

README

          

# react-dockerizing-app
react-dockerizing-app

## Running images
Our react app need two images: `one is a node for compiling and building`, and `the other is nginx for running our View`

## Working spaces
The working directory for `React`: `/my-app`, and for `nginx`: `/usr/share/nginx/html`

## Deploy My-App
```js
npx create-react-app my-app
cd my-app
npm start
```

## Create a docker image
Create a docker image from the docker file doing:
```js
docker image build -t / .
docker push /
```

## Test it
```js
docker container run -d -p 8080:80 /
```

## Composing images
We can docker-compose, to escale our container, also for speeding up the testing and building several images simultaneously in a better composable way.

```js
version: "3"

services:
ui-prod:
container_name: ui-prod
build:
context: .
dockerfile: DockerFile.prod
ports:
- "8080:80"
```

## Run docker-compose
```js
docker-compose up
```
---
### Further information
[ng-inx](http://nginx.org/en/docs/ngx_core_module.html)

[docker containers](https://www.docker.com/get-started)

[docker compose](https://docs.docker.com/compose/reference/help/)

---
### :100: Thanks!
#### Now, don't be an stranger. Let's stay in touch!

> I'm a passionately curious Front-end Engineer. I like sharing what I know, and learning what I don't. London, UK.

##### :radio_button: linkedin: @LeoLaneseltd
##### :radio_button: Twitter: @LeoLaneseltd
##### :radio_button: Portfolio: www.leolanese.com
##### :radio_button: DEV.to: dev.to/leolanese
##### :radio_button: Blog: leolanese.com/blog
##### :radio_button: Questions / Suggestion / Recommendation: developer@leolanese.com