-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
compose.yaml
86 lines (79 loc) · 2.33 KB
/
compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
# --- Docker Compose Configuration --- #
# - Docker Compose V2
# - https://docs.docker.com/compose/compose-file/
#
# Build the Clojure Service from source code
# and run on port 8080
#
# Examples of persistence with Postgres and mysql docker images
# and local data storage to facilitate data restoration
name: "clojure-service"
services:
# --- Clojure Service --- #
clojure-service:
platform: linux/amd64
# Build using Dockerfile - relative path or Git repository
build:
# Use Dockerfile in project root
context: ./
# dockerfile # alternate name for Dockerfile
environment:
- COMPOSE_PROJECT_NAME
command: echo "Build and run ${COMPOSE_PROJECT_NAME}"
ports:
- 8080:8080
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 1m00s
timeout: 10s
retries: 5
start_period: 7s
# depends_on:
# - "postgres"
# - "mysql"
# --- Postgres Relational Database --- #
# https://github.com/docker-library/docs/blob/master/postgres/README.md
# postgres:
# image: "postgres:15.2-alpine"
# restart: always
# environment:
# # superuser password - must not be empty
# POSTGRES_PASSWORD: "$DOCKER_POSTGRES_ROOT_PASSWORD"
# # Set User Credentials - optional
# POSTGRES_USER: "$DOCKER_POSTGRES_USER"
# POSTGRES_DB: "$DOCKER_POSTGRES_USER"
# healthcheck:
# test: [“CMD-SHELL”, “pg_isready”]
# interval : 1s
# timeout: 5s
# retries: 10
# # start_period: 10s
# # Persist Postgres database schema in a docker volume
# volumes:
# - postgres-data:/var/lib/postgres/data
# postgres web-based administration tool
# posgres-adminer:
# image: adminer
# restart: always
# ports:
# - 8080:8080
# --- MySQL Relational Database --- #
# mysql:
# image: "mysql/mysql-server:5.7"
# environment:
# MYSQL_USER: "$DOCKER_SERVICE_DB_USER"
# MYSQL_PASSWORD: "$DOCKER_SERVICE_DB_PASSWORD"
# MYSQL_DATABASE: "service"
# MYSQL_ROOT_PASSWORD: "$DOCKER_MYSQL_ROOT_PASSWORD"
# ports:
# - "3306:3306"
# expose:
# - "3306"
# # Persist MySQL database schema in a docker volume
# volumes:
# - mysql-data:/var/lib/mysql
# Mount project root
# volumes:
# postgres-data:
# mysql-data: