-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
documentation updates and dockerfile
- Loading branch information
1 parent
004fbac
commit 1889cc6
Showing
15 changed files
with
120 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,41 @@ | ||
## Using Docker | ||
|
||
### Client | ||
Reference: https://github.com/avatsaev/angular4-docker-example | ||
|
||
``` | ||
docker build -t client . | ||
docker run -d -p 8080:80 client | ||
``` | ||
|
||
|
||
## General | ||
0. Installation Node.js and Npm | ||
``` | ||
$ sudo apt-get install nodejs npm | ||
sudo apt-get install nodejs npm | ||
``` | ||
1. Clone the repo | ||
``` | ||
$ git clone https://github.com/CSE-Projects/crypto-watch.git | ||
git clone https://github.com/CSE-Projects/crypto-watch.git | ||
``` | ||
## Server | ||
### Server | ||
Check [README.md](blob/master/server/README.md) | ||
### Client | ||
## Client | ||
1. Move to the client folder | ||
``` | ||
$ cd client | ||
cd client | ||
``` | ||
2. install dependencies | ||
``` | ||
$ npm install | ||
npm install | ||
``` | ||
3. Run locally | ||
``` | ||
$ ng serve -o | ||
ng serve -o | ||
``` | ||
The client app can be accessed from http://localhost:4200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
### Credits: https://github.com/avatsaev/angular4-docker-example | ||
|
||
### STAGE 1: Build ### | ||
|
||
# We label our stage as 'builder' | ||
FROM node:9-alpine as builder | ||
|
||
COPY package.json package-lock.json ./ | ||
|
||
RUN npm set progress=false && npm config set depth 0 && npm cache clean --force | ||
|
||
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build | ||
RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app | ||
|
||
WORKDIR /ng-app | ||
|
||
COPY . . | ||
|
||
## Build the angular app in production mode and store the artifacts in dist folder | ||
RUN $(npm bin)/ng build --prod | ||
|
||
|
||
### STAGE 2: Setup ### | ||
|
||
FROM nginx:1.13.3-alpine | ||
|
||
## Copy our default nginx config | ||
COPY nginx/default.conf /etc/nginx/conf.d/ | ||
|
||
## Remove default nginx website | ||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
## From 'builder' stage copy over the artifacts in dist folder to default nginx public folder | ||
COPY --from=builder /ng-app/dist /usr/share/nginx/html | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:10 | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN npm install | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### Server | ||
|
||
Environment variables to be set | ||
|
||
- Secret for jwt token generation | ||
- Username and password to connect to the database | ||
|
||
`/bin/.env` file contains default variables set for non-prod use. They are loaded using [dotenv](https://www.npmjs.com/package/dotenv) package | ||
|
||
### Usage | ||
|
||
Assuming mysql server is up on port 3306 and access allowed with the username and password | ||
``` | ||
npm start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
JWT_SECRET=YOUR_SECRET | ||
DB_USERNAME=crypto_watch | ||
DB_PASSWORD=crypto_watch123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.