This is the official Docker image for the OpenContact API.
377
This is the official Docker image for the OpenContact API, a backend service for managing contacts and schedules.
The quickest way to run the OpenContact API is via the docker run command. You must provide the necessary environment variables for the database connection.
This image requires a running PostgreSQL database. You can start one easily with Docker:
docker run -d --name opencontact-db \
-e POSTGRES_DB=opencontact \
-e POSTGRES_USER=user \
-e POSTGRES_PASSWORD=password \
--network opencontact-net \
postgres:15-alpine
Now, run the OpenContact API image, connecting it to the database network and providing the correct credentials.
docker run -d --name opencontact-api \
-p 8080:8080 \
--network opencontact-net \
-e SPRING_DATASOURCE_URL=jdbc:postgresql://opencontact-db:5432/opencontact \
-e SPRING_DATASOURCE_USERNAME=user \
-e SPRING_DATASOURCE_PASSWORD=password \
rafaelqsantosrqs/opencontact-api:latest
The API will then be available at http://localhost:8080.
The application is configured via the following environment variables:
| Variable | Description | Example Value |
|---|---|---|
| SPRING_DATASOURCE_URL | PostgreSQL connection URL | jdbc:postgresql://db:5432/my_database |
| SPRING_DATASOURCE_USERNAME | Database username | app_user |
| SPRING_DATASOURCE_PASSWORD | Database password | supersecret123 |
| JPA_DDL_AUTO | Hibernate schema management strategy | validate |
| JPA_SHOW_SQL | Whether to log executed SQL queries | true |
| JPA_FORMAT_SQL | Whether to pretty-print SQL queries | true |
| SPRING_LIQUIBASE_CONTEXTS | Liquibase context used to run seeds/migrations | dev |
For local development or to run a complete stack with a single command, you can use the docker-compose.yaml file from the source repository.
.env file from the .env.template.docker-compose up.This image is built using a multi-stage Dockerfile for optimization and security.
openjdk:17-slim base and copies only the final application .jar.springuser) to enhance security.Content type
Image
Digest
sha256:fa3bfd901…
Size
126.2 MB
Last updated
about 1 year ago
docker pull rafaelqsantosrqs/opencontact-api