Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueSCar committed May 28, 2020
0 parents commit 5ade619
Show file tree
Hide file tree
Showing 44 changed files with 15,432 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not ie <= 8
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
.vscode
dist
node_modules
.dockerignore
.gitignore
Dockerfile
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 4
end_of_line = crlf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
quote_type = single
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local
.env

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:12-buster

RUN mkdir -p /home/node/risk-assignment-site/node_modules && mkdir -p /home/node/risk-assignment-siten/dist && chown -R node:node /home/node/risk-assignment-site

WORKDIR /home/node/risk-assignment-site

COPY package*.json ./

RUN npm install pm2 -g
RUN npm install

COPY . .
COPY --chown=node:node . .

RUN npm run build

RUN chmod -R 777 ./dist

USER node

COPY setup.sh /usr/local/bin/

ENTRYPOINT [ "setup.sh" ]

EXPOSE 8080

CMD [ "pm2-runtime", "index.js" ]
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# risk-admin

## Project setup
```
npm install
```

### Build front-end
```
npm run build
```

### Run site
```
node index.js
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
10 changes: 10 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
presets: [
[
'@vue/app',
{
useBuiltIns: 'entry'
}
]
]
};
29 changes: 29 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const bluebird = require('bluebird');
const dotenv = require('dotenv');
const express = require('express');
const http = require('http');
const passport = require('passport');
const pgp = require('pg-promise');
const socket = require('socket.io');

const dbConfig = require('./server/database');
const expressConfig = require('./server/express');
const passportConfig = require('./server/passport');

(async () => {
dotenv.config();

const serverPort = process.env.SERVER_PORT;

const db = dbConfig(bluebird, pgp);
passportConfig(passport, db);

const app = express();
const httpApp = http.Server(app);

httpApp.listen(serverPort, console.log(`Server running on port ${serverPort}`));

const io = socket(httpApp);

await expressConfig(express, app, db, io, passport);
})().catch(console.error);
Loading

0 comments on commit 5ade619

Please sign in to comment.