WARNING! This is a new feature, currently in BETA. Only these containers are available: MySQL, PostgreSQL, MongoDB, Cassandra, Elasticsearch
When generating your application, if you choose MySQL, PostgreSQL, MongoDB or Cassandra, a docker-compose.yml
or docker-compose-prod.yml
file is generated in your folder project.
If you choose Elasticsearch as search engine, the configuration will be included in docker-compose-prod.yml
.
So you can use docker-compose to start your database in development or production profile.
All these images come from the official Docker Hub:
You have to install Docker and Docker Compose:
In development profile:
docker-compose up -d
In production profile (it will start Elasticsearch too if you selected it as search engine):
docker-compose -f docker-compose-prod.yml up -d
In development profile:
docker-compose build
docker-compose up -d
docker exec -it "container id" init
In production profile:
docker-compose -f docker-compose-prod.yml build
docker-compose -f docker-compose-prod.yml up -d
docker exec -it "container id" init
In development profile:
docker-compose up -d
In production profile:
docker-compose -f docker-compose-prod.yml up -d
You can use docker ps -a
to list all the containers
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fc35e1090021 mysql "/entrypoint.sh mysql" 4 seconds ago Up 4 seconds 0.0.0.0:3306->3306/tcp sampleApplication-prod-mysql
In development profile:
docker-compose stop
In production profile:
docker-compose -f docker-compose-prod.yml stop
You can use directly docker: docker stop "container id"
When you stop a container, the data are not deleted, unless you delete the container.
Be carefull! All data will be deleted:
docker rm "container id"