-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchitect.yml
95 lines (87 loc) · 3.47 KB
/
architect.yml
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
87
88
89
90
91
92
93
94
95
name: architect/template-starter-springboot
description: |
An example Architect component that uses Spring Boot to serve the API and
Hibernate to connect to an auto-provisioned PostgreSQL database.
keywords:
- java
- spring
- hibernate
- postgresql
- microservice
# Add secrets to be used by different services. For more information:
# https://docs.architect.io/deployments/secrets/
secrets:
database_name:
default: default_db
database_user:
default: default_user
database_password:
default: default_pw
# Below are the configured services for the Go component.
# For more info - https://docs.architect.io/components/services/
services:
### This service is the actual SpringBoot component ###
app:
# Build context is the location of your application relative to the architect.yml file
build:
context: .
# Main interface port used to help define the url in the top level `interfaces` block at the bottom of this file
interfaces:
main:
port: 3000
# Set environment variables for your application here
environment:
SPRING_PORT: 3000
POSTGRES_USERNAME: ${{ secrets.database_user }}
POSTGRES_PASSWORD: ${{ secrets.database_password }}
POSTGRES_URL: jdbc:postgresql://${{ services.database.interfaces.main.host}}:${{ services.database.interfaces.main.port}}/${{ secrets.database_name }}
ENVIRONMENT: prod
# We want our app to start up after the db is running so that we can connect to it on startup!
# This block contains a list of services we need to start before 'app' starts.
depends_on:
- database
# The liveness_probe makes sure the application is healthy - if not, it will re-start the application
liveness_probe:
# Uses curl to check if this route returns a 200
path: /health
port: 3000
interval: 5s
# Debug block is used to modify behavior when running `architect dev` (without the --debug=false flag)
# One common example is to enable hot-reloading for local development. For more info, see -
# https://docs.architect.io/components/local-configuration/#hot-reloading
debug:
volumes:
# The name of the volume we are creating
app:
# Path to source code we want to mount relative to the architect.yml file
host_path: .
# The `WORKDIR` defined in the Dockerfile, where we want our code to be mounted
mount_path: /opt/code/src
environment:
ENVIRONMENT: dev
# This is an additional service that adds a postgres database
# to show off Architect's support for microservice architecture
# through service discovery. For more info, check out:
# https://docs.architect.io/components/service-discovery/
database:
image: postgres:14
environment:
POSTGRES_DB: ${{ secrets.database_name }}
POSTGRES_USER: ${{ secrets.database_user }}
POSTGRES_PASSWORD: ${{ secrets.database_password }}
interfaces:
main:
port: 5432
protocol: postgresql
username: ${{ secrets.database_user }}
password: ${{ secrets.database_password }}
path: /${{ secrets.database_name }}
# interfaces are used to expose our application to the gateway, allowing
# other services and dependencies to connect to one another.
# For more info - https://docs.architect.io/components/interfaces/
interfaces:
# Interface for our main SpringBoot application
main:
url: ${{ services.app.interfaces.main.url }}
ingress:
subdomain: app