Skip to content

Commit

Permalink
separate things and fix docker on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Kikmunter committed May 1, 2024
1 parent 61d241a commit e5d8ba2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ db/bk
db/bson/user.bson
db/bson/user.metadata.json
db/init-prod.js
db/db
sample-app/node_modules
docker-compose.yml
.idea
Expand Down
7 changes: 7 additions & 0 deletions db/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM mongo:7.0-jammy as lotr_mongo

COPY ./bson/* /db/data/init/

EXPOSE 27017

RUN echo "mongorestore -d lotr db/data/init" > /docker-entrypoint-initdb.d/init.sh
6 changes: 2 additions & 4 deletions docker/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ name: lotr
services:
mongo:
build:
context: ..
dockerfile: docker/dockerfile
target: lotr_mongo
context: ../db
environment:
MONGO_INITDB_DATABASE: lotr
ports:
- 27017:27017
restart: on-failure
volumes:
- ./db:/data
- ${PWD}/../db:/data

backend:
build: ../backend
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build:

# start and stop the local environment
up:
docker compose -f docker/compose.yml up
docker compose -f docker/compose.yml up -d
down:
docker compose -f docker/compose.yml down

Expand Down

0 comments on commit e5d8ba2

Please sign in to comment.