Skip to content

Commit

Permalink
Improvements on setup
Browse files Browse the repository at this point in the history
  • Loading branch information
carkod committed Nov 16, 2020
1 parent 432aec0 commit c9f0e25
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ node_modules/
.dockerenv
coverage/
build/
mongo_data

.DS_Store
.env.local
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Running front-end web app

1. Run `npm run install:clean` and `npm install`
1. Run `npm run install:clean`
2. Run `npm start`
3. Attach vscode debugger if needed

Expand All @@ -23,9 +23,11 @@
4. Copy `scp docker-compose.yml <USERNAME>@<SERVER_IP>:/var/www/binbot.carloswu.com`
In production:
5. `docker pull carloswufei/binbot`
6. `docker-compose up -d`
6. If `.env.prod` is modified, scp to remote server and replace `.env` in production with new `.env.prod`
7. `docker-compose up -d`

## Test production

1. Run `docker build --tag binbot .`
2. Run `docker-compose up`

13 changes: 8 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ version: '3.7'
services:
db:
image: mongo:latest
container_name: binbot-db
container_name: binbot_db
restart: on-failure
env_file: .env
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
MONGO_INITDB_ROOT_USERNAME: ${MONGO_AUTH_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_AUTH_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_APP_DATABASE}
ports:
- 27018:27017
volumes:
- mongodb_data_container:/data/db
- ./mongo_data:/data/db

api:
image: carloswufei/binbot
Expand All @@ -24,4 +27,4 @@ services:
- 8008:8006

volumes:
mongodb_data_container:
mongo_data:

0 comments on commit c9f0e25

Please sign in to comment.