-
Notifications
You must be signed in to change notification settings - Fork 54
2. Installation with Docker
This docker compose configuration will Build and Run the EPCIS server, together with a Mongo database server. Note: Dockerfile, the files under /epcis-docker, and this manual are the contributions of @Siko91
To use this docker configuration, you need to install Docker. It is recommended to install the newest version available, but if that is not possible, then simply install version 24 or any newer version.
The 2 files in the /epcis-docker/configs
folder will get copied into the EPCIS server container and used by the server process. Updating them will change the settings of the server.
The EPCIS server will be exposed on port 8080
, while the mongo server will be on port 27017
. If these ports are not available on your system, please modify the docker-compose.yaml
file to use different ports. For example, changing - 8080:8080
to - 3000:8080
will make it so that port 8080 on the container gets mapped to port 3000 on your computer.
The database connection string is: mongodb://root:example@localhost:27017
The Mongo data will be persisted on a docker volume called epcis_mongo_volume
.
This docker compose configuration is not intended for production environments.
Only use it for educational, development or testing purposes.
There are several security issues with this configuration:
- the database credentials are extremely simple.
- the database port is exposed to the outside network
- the EPCIS server container is not lean enough (it has unnecessary applications and libraries)
Here are the most common terminal commands to know when using the docker-compose configuration.
Note: These commands only work if you are in the
epcis-docker
folder.
docker compose up -d
Hint: the "-d" part of the command will run the containers in the background, without blocking your command line. If you wish to run the containers as a process in your command line instead, simply remove the "-d".
docker compose up -d --build
Hint: Adding the "--build" command forces the container to be rebuilt even if it was already available. Use this when there were changes in the source code of the project, or in the configuration files.
docker compose down
Hint: If you wish to remove the data stored in the volumes of the containers (for example - the MongoDB data), you can add the "-v" option at the end of this command.
docker volume rm epcis-docker_epcis_mongo_volume
Hint: This only works when the EPCIS containers are down.
docker compose down -v && docker compose up -d --build
Hint: This is most usable for testing and development. Especially if you are also using scripts that populate the DB with seed data.
docker cp oliot_epcis:/app/epcis-server-light.jar ../epcis-server-light.jar && docker cp oliot_epcis:/app/epcis-server-fat.jar ../epcis-server-fat.jar
Hint: This only works when the EPCIS server container is up and running
mkdir -p ../log && docker cp oliot_epcis:/log/epcis-docker.log ../log/epcis-docker.log && docker cp oliot_epcis:/log/accessLog-docker.log ../log/accessLog-docker.log
Hint: This only works when the EPCIS server container is up and running