Sign inSign up

cerberus237/adaptable-teastore-all

By cerberus237

Updated about 1 year ago

All Adaptable TeaStore services in a single image

Image
Developer tools
Web servers
1

571

cerberus237/adaptable-teastore-all repository overview

Adaptable TeaStore All Service Documentation

1. Overview of the Component

Description

The Adaptable TeaStore All image enables you to run the complete Adaptable TeaStore application in a single container, requiring only an external database. This setup is ideal for quick installations and evaluations. For more advanced usage or research scenarios, it is recommended to deploy each service in its own container.

Architecture

This image encapsulates all components of the Adaptable TeaStore, including the web UI, recommender, persistence, and other services. Each service can communicate using REST and is designed for easy scaling and management.

2. Setting Up the Database

To set up the database, you can either install it manually or run the recommended TeaStore database container:

docker run -p 3306:3306 -d cerberus237/adaptable-teastore-db

After the database is running, you can start the Adaptable TeaStore container and specify the database address with the following command:

docker run -e "DB_HOST=10.1.1.1" -p 8080:8080 -d cerberus237/adaptable-teastore-all
Important Note

The DB_HOST environment variable must not be set to "localhost" or "127.0.0.1". Instead, use the host machine's hostname or an externally accessible IP when running the database on the same machine as the Adaptable TeaStore container.

Accessing the UI

You can access the Adaptable TeaStore's UI on the published port. For example, if running on a host with the IP 10.1.1.2, you can access it using:

http://10.1.1.2:8080/tools.descartes.teastore.webui/

3. Sample Docker Compose Configuration

Here’s a sample docker-compose.yml file to demonstrate how to set up the Adaptable TeaStore with a database:

version: '3'
services:
  db:
    image: cerberus237/adaptable-teastore-db
    expose:
      - "3306"
    ports:
      - "3306:3306"
  adaptable-teastore:
    depends_on:
      - db
    image: cerberus237/adaptable-teastore-all
    expose:
      - "8080"
    ports:
      - "8080:8080"
    environment:
      DB_HOST: "db"
Explanation of Docker Compose Directives:
  • db: The service for the database, exposing port 3306.
  • adaptable-teastore: The main service for running the Adaptable TeaStore, which depends on the database service. It exposes port 8080 and sets the environment variable for the database host.

4. Overview of the Dockerfile

The Dockerfile for the Adaptable TeaStore All image is structured as follows:

FROM cerberus237/adaptable-teastore-base:latest
LABEL org.opencontainers.image.authors="Inria R&D engineer <[email protected]>"

COPY target/*.war /usr/local/tomcat/webapps/
Explanation of Dockerfile Components:
  • Base Image: Utilizes the latest version of the Adaptable TeaStore Base image, which provides the necessary Tomcat server setup.
  • WAR Files: Copies all compiled WAR files from the target directory into the Tomcat webapps directory for deployment.

5. Overview of pom.xml

The pom.xml file is used to generate all the WAR files for each service in the Adaptable TeaStore. Below is its structure:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>docker.all</artifactId>
	<name>TeaStore Docker All Services Image</name>
	<url>http://descartes.tools</url>
	<packaging>pom</packaging>
	<properties>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	<dependencies>
		<dependency>
			<groupId>tools.descartes.teastore</groupId>
			<artifactId>registry</artifactId>
			<version>${teastoreversion}</version>
			<type>war</type>
		</dependency>
		<!-- Additional dependencies for other services -->
	</dependencies>
	<build>
		<plugins>
			<plugin>
		        <groupId>org.apache.maven.plugins</groupId>
		        <artifactId>maven-dependency-plugin</artifactId>
		        <version>3.1.0</version>
		        <executions>
		          <execution>
		            <id>copy</id>
		            <phase>generate-resources</phase>
		            <goals>
		              <goal>copy</goal>
		            </goals>
		            <configuration>
		              <artifactItems>
		                <artifactItem>
		                  <groupId>tools.descartes.teastore</groupId>
						  <artifactId>registry</artifactId>
						  <type>war</type>
		                  <overWrite>true</overWrite>
		                  <outputDirectory>${project.build.directory}/</outputDirectory>
		                  <destFileName>tools.descartes.teastore.registry.war</destFileName>
		                </artifactItem>
		                <!-- Additional artifact items for other services -->
		              </artifactItems>
		              <outputDirectory>${project.build.directory}/</outputDirectory>
		              <overWriteReleases>false</overWriteReleases>
		              <overWriteSnapshots>true</overWriteSnapshots>
		            </configuration>
		          </execution>
		        </executions>
		      </plugin>
		</plugins>
		<finalName>tools.descartes.teastore.dockerbase</finalName>
	</build>
	<parent>
		<groupId>tools.descartes.teastore</groupId>
		<artifactId>parent</artifactId>
		<version>${teastoreversion}</version>
		<relativePath>../..</relativePath>
	</parent>
</project>
Explanation of pom.xml Components:
  • Dependencies: Lists all services (e.g., registry, persistence, image, recommender, auth, webui) as dependencies to be included in the build.
  • Build Process: Configures the Maven build process to copy the necessary WAR files into the target directory.

6. Summary

The Adaptable TeaStore All image provides a streamlined way to run the entire Adaptable TeaStore application in a single container, making it easy to set up and test. The provided Dockerfile and pom.xml facilitate the integration of various services, ensuring a comprehensive and efficient deployment. For further details, refer to the Getting Started documentation.

Tag summary

Content type

Image

Digest

sha256:5b1ce5985

Size

423.1 MB

Last updated

about 1 year ago

docker pull cerberus237/adaptable-teastore-all