defined compose file for deploy
This commit is contained in:
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
@@ -13,7 +13,7 @@
|
||||
"build": true,
|
||||
},
|
||||
"files": [
|
||||
"${workspaceFolder}/docker-compose.yml"
|
||||
"${workspaceFolder}/docker-compose-debug.yml"
|
||||
],
|
||||
"isBackground": true,
|
||||
"problemMatcher": "Terminal will be reused by tasks, press any key to close it"
|
||||
|
||||
21
README.md
21
README.md
@@ -1,6 +1,5 @@
|
||||
# ToDo
|
||||
* year pagination
|
||||
* build & deploy via docker
|
||||
|
||||
# Authentication
|
||||
Authentication consists of the following parts:
|
||||
@@ -16,4 +15,22 @@ Source:
|
||||
# Multi-User Support
|
||||
Each location record is marked with a user ID.
|
||||
|
||||
All the actions user `withUser` to fetch user ID, which is then used in all the DB operations.
|
||||
All the actions user `withUser` to fetch user ID, which is then used in all the DB operations.
|
||||
|
||||
# Deploying
|
||||
The deployment is done via Docker:
|
||||
* build docker image
|
||||
* deploy Docker service
|
||||
|
||||
## Building Docker image
|
||||
Run the following command:
|
||||
```bash
|
||||
docker build . -t utility-bills-tracker:1.2.0
|
||||
```
|
||||
The image will be stored in the local Docker instance.
|
||||
|
||||
## Deploying Docker service
|
||||
Run the following command:
|
||||
```bash
|
||||
docker stack deploy -c docker-compose-deploy.yml utility-bills-tracker:1.2.0
|
||||
```
|
||||
32
docker-compose-deploy.yml
Normal file
32
docker-compose-deploy.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
# this compose file runs Postgres db and exposes it's port to the host machine
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
web-app:
|
||||
image: utility-bills-tracker:latest
|
||||
restart: always
|
||||
ports:
|
||||
- 3000:3000
|
||||
environment:
|
||||
MONGODB_URI: mongodb://root:XZtq9WakpT35wb8C76omRx@mongo:27017/
|
||||
GOOGLE_ID: 355397364527-adjrokm6hromcaaar0qfhk050mfr35ou.apps.googleusercontent.com
|
||||
GOOGLE_SECRET: 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
|
||||
AUTH_SECRET: Gh0jQ35oq6DR8HkLR3heA8EaEDtxYN/xkP6blvukZ0w=
|
||||
mongo:
|
||||
image: mongo:6.0.12
|
||||
restart: always
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: XZtq9WakpT35wb8C76omRx
|
||||
volumes:
|
||||
- ./mongo:/data/db
|
||||
mongo-express:
|
||||
image: mongo-express
|
||||
restart: always
|
||||
ports:
|
||||
- 8081:8081
|
||||
environment:
|
||||
ME_CONFIG_MONGODB_ADMINUSERNAME: root
|
||||
ME_CONFIG_MONGODB_ADMINPASSWORD: XZtq9WakpT35wb8C76omRx
|
||||
ME_CONFIG_MONGODB_URL: mongodb://root:XZtq9WakpT35wb8C76omRx@mongo:27017/
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "rezije",
|
||||
"name": "utility-bills-tracker",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
Reference in New Issue
Block a user