From 3583de3f9eb11fbf7a6ce774625d6e0b2a0c3ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Thu, 4 Jan 2024 11:31:55 +0100 Subject: [PATCH] =?UTF-8?q?kreiran=20docker-compose=20koji=20pokre=C4=87e?= =?UTF-8?q?=20mongodb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- docker-compose.yml | 37 +++++++++++++------------------------ 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 1f9d4b9..8ac3a8f 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,6 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts -postgres \ No newline at end of file +postgres + +mongo \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index ccf20b0..165e660 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,33 +1,22 @@ # this compose file runs Postgres db and exposes it's port to the host machine version: "3.7" -volumes: - postgres: - pgadmin: - services: - db: - image: postgres:16.1-alpine + mongo: + image: mongo:6.0.12 restart: always environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: dashboard - ports: - - 5432:5432 + MONGO_INITDB_ROOT_USERNAME: root + MONGO_INITDB_ROOT_PASSWORD: example volumes: - # store postgres data in a local `postgres` directory - - postgres:/var/lib/postgresql/data - pgadmin: - image: dpage/pgadmin4:8.1 + - ./mongo:/data/db + mongo-express: + image: mongo-express + restart: always + ports: + - 8081:8081 environment: - PGADMIN_DEFAULT_EMAIL: admin@example.com - PGADMIN_DEFAULT_PASSWORD: SuperSecret - PGADMIN_LISTEN_PORT: 80 - ports: - - 8080:80 - volumes: - - pgadmin:/var/lib/pgadmin - depends_on: - - db + ME_CONFIG_MONGODB_ADMINUSERNAME: root + ME_CONFIG_MONGODB_ADMINPASSWORD: example + ME_CONFIG_MONGODB_URL: mongodb://root:example@mongo:27017/