Skip to content

Commit

Permalink
Refatora docker-compose (#169)
Browse files Browse the repository at this point in the history
* refactor: change docker-compose to mongodb

* Revert "refactor: change docker-compose to mongodb"

This reverts commit 79189a4.

* refactor: change docker-compose to mongodb

---------

Co-authored-by: Matheus-PixaFlow <matheus.vinicius@equipe.pixaflow.com>
Co-authored-by: MatheusVinicius77 <matheuvinicius@bus7@hotmail.com>
Co-authored-by: Paulo Victor <pilutechinformatica@gmail.com>
  • Loading branch information
4 people authored Aug 23, 2024
1 parent 388ab37 commit c8be42d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ HOSTNAME='localhost'
PORT=3000
SECRET_KEY='321'
DATABASE_URL="postgresql://postgres:password@localhost:5432/octopost"


MONGO_INITDB_ROOT_USERNAME
MONGO_INITDB_ROOT_PASSWORD
ME_CONFIG_MONGODB_ADMINUSERNAME
ME_CONFIG_MONGODB_ADMINPASSWORD
ME_CONFIG_MONGODB_URL
29 changes: 21 additions & 8 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@ services:
container_name: octopost-db-dev
profiles:
- dev
image: postgres:alpine3.19
image: mongo:latest
ports:
- '5432:5432'
- '27017:27017'
environment:
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: 'password'
POSTGRES_DB: 'octopost'
PGDATA: '/var/lib/postgresql/mydata'
MONGO_INITDB_ROOT_USERNAME: $MONGO_INITDB_ROOT_USERNAME
MONGO_INITDB_ROOT_PASSWORD: $MONGO_INITDB_ROOT_PASSWORD
volumes:
- db:/var/lib/postgresql/mydata
- db:/var/lib/mongodb/mydata
networks:
- octopost


mongo-express:
image: mongo-express
depends_on: [db-dev]
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: $ME_CONFIG_MONGODB_ADMINUSERNAME
ME_CONFIG_MONGODB_ADMINPASSWORD: $ME_CONFIG_MONGODB_ADMINPASSWORD
ME_CONFIG_MONGODB_URL: $ME_CONFIG_MONGODB_URL
ME_CONFIG_BASICAUTH: false
links:
- db-dev
networks:
- octopost

api:
build:
context: ./
Expand Down

0 comments on commit c8be42d

Please sign in to comment.