Browse Source
Merge pull request #56 from markoilijoski/feature/dockerization
Merge pull request #56 from markoilijoski/feature/dockerization
Feature/dockerizationpull/61/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 86 additions and 33 deletions
-
18README.md
-
1api/.dockerignore
-
7api/.env.example
-
12api/Dockerfile
-
58docker-compose.yaml
-
11mongo-init/init.js
-
6web/.env.example
-
6web/Dockerfile
@ -1,4 +1,3 @@ |
|||
/dist |
|||
/node_modules |
|||
/coverage |
|||
.env |
|||
@ -1,36 +1,56 @@ |
|||
services: |
|||
textbee-web: |
|||
image: ghcr.io/vernu/textbee/web:latest |
|||
container_name: textbee-web |
|||
build: |
|||
web: |
|||
container_name: web |
|||
build: |
|||
context: ./web |
|||
dockerfile: Dockerfile |
|||
ports: |
|||
- "3000:3000" |
|||
env_file: |
|||
- path: ./web/.env |
|||
required: true |
|||
command: pnpm start |
|||
textbee-api: |
|||
image: ghcr.io/vernu/textbee/api:latest |
|||
container_name: textbee-api |
|||
build: |
|||
depends_on: |
|||
- mongo |
|||
environment: |
|||
NODE_ENV: production |
|||
|
|||
api: |
|||
container_name: api |
|||
build: |
|||
context: ./api |
|||
dockerfile: Dockerfile |
|||
target: prod |
|||
ports: |
|||
- "3005:3005" |
|||
env_file: |
|||
- path: ./api/.env |
|||
required: true |
|||
depends_on: |
|||
- textbee-db |
|||
textbee-db: |
|||
- mongo |
|||
environment: |
|||
NODE_ENV: production |
|||
|
|||
mongo: |
|||
container_name: mongo |
|||
image: mongo |
|||
container_name: textbee-db |
|||
restart: always |
|||
ports: |
|||
- "27017:27017" |
|||
environment: |
|||
MONGO_INITDB_ROOT_USERNAME: adminUser |
|||
MONGO_INITDB_ROOT_PASSWORD: adminPassword |
|||
MONGO_INITDB_DATABASE: TextBee |
|||
volumes: |
|||
- textbee-db-data:/data/db |
|||
# THe following scripts creates TextBee DB automatically, also the user which web and api are connecting with. |
|||
- ./mongo-init:/docker-entrypoint-initdb.d:ro |
|||
mongo-express: |
|||
container_name: mongo-ee |
|||
image: mongo-express |
|||
restart: always |
|||
ports: |
|||
- "27017:27017" |
|||
- "8081:8081" |
|||
environment: |
|||
ME_CONFIG_MONGODB_ADMINUSERNAME: adminUser |
|||
ME_CONFIG_MONGODB_ADMINPASSWORD: adminPassword |
|||
ME_CONFIG_MONGODB_URL: mongodb://adminUser:adminPassword@mongo:27017/ |
|||
ME_CONFIG_BASICAUTH: "false" |
|||
depends_on: |
|||
- mongo |
|||
|
|||
volumes: |
|||
textbee-db-data: |
|||
@ -0,0 +1,11 @@ |
|||
db = db.getSiblingDB("TextBee"); |
|||
|
|||
db.createUser({ |
|||
user: "textbeeUser", |
|||
pwd: "textbeePassword", |
|||
roles: [{ role: "readWrite", db: "TextBee" }] |
|||
}); |
|||
|
|||
db.init.insertOne({ createdBy: "seed" }); |
|||
|
|||
print("✅ TextBee DB initialized and user created."); |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue