Reputation: 1544
I would like to setup my JHipster project on a remote server utilising docker-compose
as per here.
Am I right in thinking (for the simplest approach), these are the steps I might follow:
./mvnw package -Pprod docker:build
to produce a docker image of the application.src/main/docker
to a directory (e.g. dir/on/remote
) on the remote server.docker-compose -f dir/on/remote/app.yml up
on the remote server.Thanks for your help.
Also any suggestions on how this process may be improved would be appreciated.
Upvotes: 0
Views: 627
Reputation: 7809
Expecting that your server is Ubunutu, SSH to your server,
Install docker, docker-compose, install JAVA and set JAVA_HOME
Two approches
Second approch would be better to reduce the confusion
Clone your repo to server
cd <APPLICATION_FOLDER>
Do
./mvnw package -Pprod docker:build -DskipTests
List the images created
docker images
You can ignore -DskipTests , if you are writing test code.
Do
docker-compose -f /src/main/docker/app.yml up -d
List containers running
docker ps -a
Logs of the container
docker logs <CONTAINER_ID>
Upvotes: 1