This is the mobile server backend supporting Inji.
- Java SE 11
- Maven
mvn clean package
mvn spring-boot:run -Dspring.profiles.active=local
- bin: service jar files
- conf: configuration files for docker services.
- data: using to store shared VC event and generated files.
Follow the build section to compile and get the mimoto-*.jar file in the target folder.
Copy jar files to bin folder. Websub (hub.jar) and safety net is optional, depends on the client app implementation.
conf/nginx/conf.d/mimoto.conf
upstream mimoto-service {
server mimoto-service:8088;
}
server {
listen 80;
listen [::]:80;
access_log /var/log/nginx/mimoto-service.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /v1/mimoto {
proxy_pass http://mimoto-service/v1/mimoto;
proxy_set_header Host $http_host; # required for docker client's sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
docker-compose.yml
version: "3.9"
services:
nginx:
image: nginx:alpine
volumes:
- ./conf/nginx/proxy_params:/etc/nginx/proxy_params
- ./conf/nginx/conf.d:/etc/nginx/conf.d
hostname: nginx
restart: always
ports:
- 80:80
links:
- mimoto-service
- websub
- safetynet
depends_on:
- mimoto-service
mimoto-service:
image: openjdk:11-jre-slim
volumes:
- ./bin:/opt/mimoto-service
- ./data:/data
hostname: mimoto-service
restart: always
command: >
bash -c "cd /data && java -jar \
-Dpublic.url=https://YOUR_PUBLIC_URL_FOR_MIMOTO_SERVICE \
-Dcredential.data.path=/data \
-Dmosip.event.delay-millisecs=5000 \
-Dwebsub-resubscription-delay-millisecs=300000 \
-Dsafetynet.api.key=GOOGLE_API_KEY \
/opt/mimoto-service/mimoto-*.jar"
expose:
- 8088
Note:
- Replace public.url with your public accessible domain. For dev or local env ngrok is recommended.
- Google safetynet API key can be generate from Google Cloud Console.
docker-compose up -d
Copy and replace the new version of the jar files in the bin folder and restart the docker service.
docker-compose restart mimoto-service
Credits listed here