Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service mongoDB in docker-compose #33

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ RUN useradd \
--home /it-dgc-verifier-service \
--shell /bin/bash \
dgc \
&& chown --recursive dgc:root /it-dgc-verifier-service \
&& chown --recursive dgc:root /it-dgc-verifier-service \
&& chmod -R g+rwx /it-dgc-verifier-service
USER dgc


ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /it-dgc-verifier-service/app.jar --spring.config.location=file:/it-dgc-verifier-service/config/application.properties" ]
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /it-dgc-verifier-service/app.jar --spring.config.location=classpath:/,file:/it-dgc-verifier-service/config/" ]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ Once the requirements above shown are satisfied open a shell with working direct
```shell script
docker-compose up --build
```

##### Mongodb for testing
Before running Integration test launch MongoDB

```shell script
docker-compose up mongo
```

#### Dependencies

The project has been implemented in [Java 11](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html).
Expand Down
1 change: 1 addition & 0 deletions config/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# track this folder
12 changes: 10 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ services:
- 9080:9080
environment:
- SERVER_PORT=9080
- MONGO_DB_URI=mongodb://host.docker.internal:27017/DGC-dev
- MONGO_DB_URI=mongodb://mongo:27017/DGC-dev
volumes:
- ./it-dgc-verifier-service/config:/it-dgc-verifier-service/config
- ./config:/it-dgc-verifier-service/config
networks:
- backend_net

mongo:
image: mongo
restart: always
ports:
- 27017:27017
networks:
- backend_net

2 changes: 2 additions & 0 deletions src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
spring.application.name=Italian services for DGC verifier apps
server.servlet.context-path=/

spring.profiles.active=test

server.port=9080

#MONGODB
Expand Down