Merge branch 'develop'

pull/128/MERGE
13621160019@163.com 2022-02-22 11:45:18 +08:00
commit ebc47a32ab
3 changed files with 59 additions and 32 deletions

25
admin/README.md vendored
View File

@ -25,19 +25,30 @@ nano nginx.conf
```
* Build a Docker image
On Windows:
```bash
cd myems/admin
cp -r myems/admin c:\myems-admin
cd c:\myems-admin
docker build -t myems/myems-admin .
```
* Run a Docker container
If run on Windows host, bind-mount a share upload file folder at c:\myems-upload to the container
-v parameter must be same with that in myems-api
On Linux:
```bash
docker run -d -p 8001:8001 -v c:\myems-upload:/var/www/html/admin/upload --restart always --name myems-admin myems/myems-admin
cp -r myems/admin /myems-admin
cd /myems-admin
docker build -t myems/myems-admin .
```
If run on Linux host, bind-mount a share upload file folder at /myems-upload to the container
* Run a Docker container
If run on Windows host, bind-mount a share upload file folder at c:\myems-upload to the container and also bind-mount nginx.conf
-v parameter for upload folder must be same with that in myems-api
```bash
docker run -d -p 8001:8001 -v /myems-upload:/var/www/html/admin/upload --restart always --name myems-admin myems/myems-admin
docker run -d -p 8001:8001 -v c:\myems-upload:/var/www/html/admin/upload -v c:\myems-admin/nginx.conf:/etc/nginx/nginx.conf --restart always --name myems-admin myems/myems-admin
```
If run on Linux host, bind-mount a share upload file folder at /myems-upload to the container and also bind-mount nginx.conf
```bash
docker run -d -p 8001:8001 -v /myems-upload:/var/www/html/admin/upload -v /myems-admin/nginx.conf:/etc/nginx/nginx.conf --restart always --name myems-admin myems/myems-admin
```
-d Run container in background and print container ID

View File

@ -45,20 +45,6 @@ chmod +x run.sh
In this section, you will install myems-api on Docker.
* Copy source code to root directory
On Windows:
```bash
cp -r myems/myems-api c:\
cd c:\myems-api
```
On Linux:
```bash
cp -r myems/myems-api /
cd /myems-api
```
* Duplicate example.env file as .env file and modify the .env file
Replace ~~127.0.0.1~~ with real **HOST** IP address.
```bash
@ -66,9 +52,21 @@ cp example.env .env
```
* Build a Docker image
On Windows:
```bash
cp -r myems/myems-api c:\
cd c:\myems-api
docker build -t myems/myems-api .
```
On Linux:
```bash
cp -r myems/myems-api /
cd /myems-api
docker build -t myems/myems-api .
```
* Run a Docker container
On Windows host, bind-mount a share upload folder at c:\myems-upload to the container,
and also bind-mount the .env to the container:

26
web/README.md vendored
View File

@ -73,23 +73,41 @@ nano nginx.conf
```bash
npm i --unsafe-perm=true --allow-root --legacy-peer-deps
```
* Build for production with NPM
```bash
npm run build
```
* Build a Docker image
On Windows:
```bash
cd myems/web
cp -r myems/web c:\myems-web
cd c:\myems-web
docker build -t myems/myems-web .
```
* Run a Docker container
On Linux:
```bash
docker run -dp 80:80 --restart always --name myems-web myems/myems-web
cp -r myems/web /myems-web
cd /myems-web
docker build -t myems/myems-web .
```
* Run a Docker container
If run on Windows host, bind-mount nginx.conf to the container
```bash
docker run -d -p 80:80 -v c:\myems-web/nginx.conf:/etc/nginx/nginx.conf --restart always --name myems-web myems/myems-web
```
If run on Linux host, bind-mount nginx.conf
```bash
docker run -d -p 80:80 -v /myems-web/nginx.conf:/etc/nginx/nginx.conf --restart always --name myems-web myems/myems-web
```
-d Run container in background and print container ID
-p Publish a container's port(s) to the host, 8001:8001 (Host:Container) binds port 8001 (right) of the container to TCP port 8001 (left) of the host machine.
-p Publish a container's port(s) to the host, 80:80 (Host:Container) binds port 80 (right) of the container to TCP port 80 (left) of the host machine.
--restart Restart policy to apply when a container exits