Skip to content

Commit

Permalink
[deployment] Create Makefile for docker environment. (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
landerneRPi authored Aug 13, 2021
1 parent 36a0875 commit 7fc2a19
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DOCKERFILES=docker-compose.yml
DOCKERFILES_DEV=docker-compose-dev.yml
DOCKERFILES_TEST=docker-compose-test.yml

start-prod:
docker-compose -f ${DOCKERFILES} up -d

start-dev:
docker-compose -f ${DOCKERFILES} -f ${DOCKERFILES_DEV} up -d

start-test:
docker-compose -f ${DOCKERFILES} -f ${DOCKERFILES_TEST} up -d

stop:
docker-compose -f ${DOCKERFILES} -f ${DOCKERFILES_DEV} -f ${DOCKERFILES_TEST} stop

clean:
docker-compose -f ${DOCKERFILES} -f ${DOCKERFILES_DEV} -f ${DOCKERFILES_TEST} rm -f

clean-data:
rm -r data
15 changes: 15 additions & 0 deletions docker/docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
version: '3.7'
services:
mongodb:
image: 'mongo:4.4.3'
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
volumes:
- devdb:/data/db
# volume is deleted
volumes:
devdb:
15 changes: 15 additions & 0 deletions docker/docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
version: '3.7'
services:
mongodb:
image: 'mongo:4.4.3'
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
volumes:
- testdb:/data/db
# volume is deleted
volumes:
testdb:

0 comments on commit 7fc2a19

Please sign in to comment.