A Spring Boot-based micro service for managing user profiles in the URL Shortener system.
2.2K
The URL Shortener Profile Service enables users to manage their profiles and shorten URLs. It is built with Spring Boot and JPA, using MySQL for database storage. The service is Dockerized for easy deployment and scalability.
docker run --network=host \
-e SPRING_DATASOURCE_URL="jdbc:mysql://localhost:3306/db_name?useSSL=false&allowPublicKeyRetrieval=true" \
-e SPRING_DATASOURCE_USERNAME="root" \
-e SPRING_DATASOURCE_PASSWORD="root" \
-e SPRING_PROFILES_ACTIVE="prod" \
-e SPRING_KAFKA_NOTIFICATION_TOPIC_NAME="urlshortener.notifications.email" \
-e CLOUDINARY_URL="cloudinary://<your_api_key>:<your_api_secret>@cloud_name" \
akgarg0472/urlshortener-profile-service:tag
-e: The -e flag is used to set environment variables inside the Docker container, which control various application settings.SPRING_DATASOURCE_URL:
Defines the JDBC URL for connecting to the MySQL database, including details like host, port, database name, and additional connection parameters (e.g., disabling SSL, setting the server timezone).
SPRING_DATASOURCE_USERNAME:
Specifies the username for accessing the MySQL database.
SPRING_DATASOURCE_PASSWORD:
Sets the password for the MySQL database connection.
SPRING_PROFILES_ACTIVE:
Sets the active Spring profile to prod, enabling production-specific configurations, such as database connections, Kafka, and other necessary services.
SPRING_KAFKA_NOTIFICATION_TOPIC_NAME:
Specifies the Kafka topic name used for sending email notifications (urlshortener.notifications.email).
CLOUDINARY_URL:
Provides the Cloudinary URL for media storage (e.g., profile images), which is required in the production profile to upload and store media.
--network=host:
Configures the container to use the host machine's network, enabling it to directly communicate with services like MySQL and Kafka running on the host machine.
akgarg0472/urlshortener-profile-service:tag:
Refers to the Docker image to be used, with the repository name akgarg0472/urlshortener-profile-service and the specified tag (version) of the image.
For more details or customization, you can refer to the GitHub repository.
Content type
Image
Digest
sha256:f169d28ae…
Size
160.2 MB
Last updated
over 1 year ago
docker pull akgarg0472/urlshortener-profile-service