Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eedf578

Browse files
committed
dockerize react app and update readme
1 parent 42aa2b2 commit eedf578

File tree

5 files changed

+66
-3
lines changed

5 files changed

+66
-3
lines changed

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- [Datetime (Unix , RealTime and Formatted Datetime)](js/datetime.js)
77
## React JS
88
- [React ENV Create](react-js/env.md)
9+
- [Dockerize React App](docker/react/Dockerfile)
910
- [React Socket Connection](react-js/Socket.js)
1011
- [Exportable API Endpoint](react-js/api/ApiHelper.js)
1112
- [Example API Helper Routes ](react-js/api/ExampleApi.js)
@@ -35,7 +36,7 @@
3536
## Python
3637
- [Flask Socket Connection](python/flask_socket.py)
3738
- [Flask Socket Connection with Pubsub to listen subscription messages](python/flask_pubsub.py)
38-
- [Dockerize Flask App](python/Dockerfile)
39+
- [Dockerize Flask App](docker/python/Dockerfile)
3940
- [Python Open-CV Video Recording](python/video_record.py)
4041
- [Find Router Connected Device Ip List](python/router_ip_address.py)
4142
- [Google Cloud Pub/Sub Publishing/subscription messages and subscriptions list](python/pubsub.py)
@@ -62,7 +63,7 @@
6263
- [Set Go Path](go/go-path-set.go)
6364

6465
## System
65-
- [Supervisor Installation and Procedure](system/supervisor/frontend.MD)
66+
- [Supervisor Installation and Procedure](system/supervisor/README.MD)
6667

6768
## Other
6869
- [Install Protobuf 3 on Ubuntu](https://gist.github.com/mrxmamun/c3afc8e9318135d5f79177ff528655a4)

‎docker/README.md‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Installation
2+
- Install [Docker](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04)
3+
- Make a file name Dockerfile ```touch Dockerfile```
4+
5+
### Flask App [Dockerfile](/docker/python/Dockerfile)
6+
```sh
7+
FROM python:3.8-alpine
8+
9+
RUN apk add --no-cache python3-dev \
10+
&& pip3 install --upgrade pip
11+
12+
WORKDIR /src
13+
14+
COPY . .
15+
16+
RUN pip install -r requirements.txt
17+
18+
EXPOSE 5000
19+
20+
ENTRYPOINT ["python3"]
21+
22+
CMD ["app.py"]
23+
```
24+
### React App [Dockerfile](/docker/python/Dockerfile)
25+
```sh
26+
# base image
27+
FROM node:12.13.0-alpine
28+
29+
# set working directory
30+
WORKDIR /src
31+
32+
# add `/app/node_modules/.bin` to $PATH
33+
ENV PATH /src/node_modules/.bin:$PATH
34+
35+
# install and cache app dependencies
36+
COPY . .
37+
RUN npm install --silent
38+
RUN npm install react-scripts@3.1.1 -g --silent
39+
40+
# start app
41+
CMD ["npm", "start"]
42+
```
43+
### Instruction
44+
- `docker build -t name .`
45+
- `docker run --name name -d -p port:port name` or
46+
- `docker run --name name -d -p port:port --network host name`

‎python/Dockerfile‎ renamed to ‎docker/python/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7-alpine
1+
FROM python:3.8-alpine
22

33
RUN apk add --no-cache python3-dev \
44
&& pip3 install --upgrade pip

‎docker/react/Dockerfile‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# base image
2+
FROM node:12.13.0-alpine
3+
4+
# set working directory
5+
WORKDIR /src
6+
7+
# add `/app/node_modules/.bin` to $PATH
8+
ENV PATH /src/node_modules/.bin:$PATH
9+
10+
# install and cache app dependencies
11+
COPY . .
12+
RUN npm install --silent
13+
RUN npm install react-scripts@3.1.1 -g --silent
14+
15+
# start app
16+
CMD ["npm", "start"]
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /