Skip to content

Commit

Permalink
feat: add nginx config (#71)
Browse files Browse the repository at this point in the history
* feat: add nginx config
  • Loading branch information
xudafeng authored Jul 5, 2019
1 parent b7e9090 commit 5ac0d60
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 7 deletions.
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ services:
environment:
- MYSQL_HOST=mysql
- RELIABLE_HOST=127.0.0.1 # replace it with your hostname: RELIABLE_HOST=example.com
static:
image: macacajs/reliable-nginx
restart: always
volumes:
- $HOME/reliable_home/static:/usr/share/nginx/html
ports:
- "9920:80"

2 changes: 2 additions & 0 deletions docker/reliable-nginx/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.md

3 changes: 3 additions & 0 deletions docker/reliable-nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM nginx:latest

COPY default.conf /etc/nginx/conf.d/default.conf
33 changes: 33 additions & 0 deletions docker/reliable-nginx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# reliable-nginx

---

[![docker pull][docker-pull-image]][docker-url]
[![docker pull][docker-size-image]][docker-url]
[![docker pull][docker-layers-image]][docker-url]

[docker-pull-image]: https://img.shields.io/docker/pulls/macacajs/reliable-nginx.svg?style=flat-square&logo=dockbit
[docker-size-image]: https://img.shields.io/microbadger/image-size/macacajs/reliable-nginx.svg?style=flat-square&logo=dockbit
[docker-layers-image]: https://img.shields.io/microbadger/layers/macacajs/reliable-nginx.svg?style=flat-square&logo=dockbit
[docker-url]: https://hub.docker.com/r/macacajs/reliable-nginx/

## production

```bash
$ docker run --name reliable-nginx \
-p 9920:80 \
-v $HOME/reliable_home/static:/usr/share/nginx/html:ro \
-d macacajs/reliable-nginx
```

---

Just for developer

## build image

```bash
$ cd docker/reliable-nginx
$ docker build --pull -t macacajs/reliable-nginx .
$ docker push macacajs/reliable-nginx
```
22 changes: 22 additions & 0 deletions docker/reliable-nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
server {
listen 80;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
autoindex on;
root /usr/share/nginx/html;
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
19 changes: 17 additions & 2 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ module.exports = {
macacaEcosystem.en,
],
sidebar: {
'/guide/': genSidebarConfig(['Guide', 'CI/CD', 'Community']),
'/guide/': genSidebarConfig([
'Guide',
'CI/CD',
'Community'
]),
},
},
'/zh/': {
Expand All @@ -90,7 +94,11 @@ module.exports = {
macacaEcosystem.zh,
],
sidebar: {
'/zh/guide/': genSidebarConfig(['使用指南', '持续集成', '社区支持']),
'/zh/guide/': genSidebarConfig([
'使用指南',
'持续集成',
'社区支持'
]),
},
},
},
Expand Down Expand Up @@ -118,5 +126,12 @@ function genSidebarConfig(arr) {
'integrate-with-gitlab-ci',
],
},
{
title: arr[2],
collapsable: false,
children: [
'presentations',
],
},
];
}
3 changes: 3 additions & 0 deletions docs/guide/presentations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Presentations

- [部署新版 Reliable 平台](https://testerhome.com/topics/19743)
1 change: 0 additions & 1 deletion docs/guide/reliable-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,4 @@ $ RELIABLE_SERVER_URL=http://127.0.0.1:9900 ci.sh

- [ios-app-bootstrap](//github.com/app-bootstrap/ios-app-bootstrap)
- [android-app-bootstrap](//github.com/app-bootstrap/android-app-bootstrap)
- [awesome-practice-projects](//github.com/app-bootstrap/awesome-practice-projects)
- [web-app-bootstrap](//github.com/app-bootstrap/web-app-bootstrap)
3 changes: 3 additions & 0 deletions docs/zh/guide/presentations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 社区分享

- [部署新版 Reliable 平台](https://testerhome.com/topics/19743)
1 change: 0 additions & 1 deletion docs/zh/guide/reliable-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,4 @@ $ RELIABLE_SERVER_URL=http://127.0.0.1:9900 ci.sh

- [ios-app-bootstrap](//github.com/app-bootstrap/ios-app-bootstrap)
- [android-app-bootstrap](//github.com/app-bootstrap/android-app-bootstrap)
- [awesome-practice-projects](//github.com/app-bootstrap/awesome-practice-projects)
- [web-app-bootstrap](//github.com/app-bootstrap/web-app-bootstrap)
4 changes: 3 additions & 1 deletion docs/zh/guide/reliable-web-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ $ docker-compose down
Reliable 服务默认运行在 `http://127.0.0.1:9900`
Nginx 服务默认运行在 `http://127.0.0.1:9920`
Nginx 服务默认运行在 `http://127.0.0.1:9920`,服务的跟路径在
`$HOME/reliable_home/static`,如果不需要也可以去掉这项服务。
需要按需修改 [docker-compose.yml](https://github.com/macacajs/reliable/blob/master/docker-compose.yml) 配置。
Expand All @@ -66,5 +67,6 @@ Nginx 服务默认运行在 `http://127.0.0.1:9920`。
- [doc](https://github.com/macacajs/reliable/blob/master/docker/reliable-mysql/README.md)
### Reliable main app container (backend and frontend) - reliable-web
- [Dockerfile](https://github.com/macacajs/reliable/blob/master/Dockerfile)
- [doc](https://github.com/macacajs/reliable/blob/master/docker/reliable-web/README.md)
6 changes: 4 additions & 2 deletions view/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');

const pkg = require('./package');

Expand Down Expand Up @@ -31,7 +31,9 @@ module.exports = (env, argv) => {
},

output: {
path: DIST_DIR ? path.resolve(DIST_DIR) : path.join(__dirname, '..', 'app', 'public'),
path: DIST_DIR
? path.resolve(DIST_DIR)
: path.join(__dirname, '..', 'app', 'public'),
publicPath: 'public',
filename: '[name].js',
},
Expand Down

0 comments on commit 5ac0d60

Please sign in to comment.