-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchitect.yml
More file actions
106 lines (101 loc) · 3.54 KB
/
Copy patharchitect.yml
File metadata and controls
106 lines (101 loc) · 3.54 KB
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
96
97
98
99
100
101
102
103
104
105
106
name: react
description: |
An Architect Starter Project using React.
homepage: https://github.com/architect-templates/react
keywords:
- react
- express
- javascript
secrets:
db_user:
description: Root user to assign to the component's DB
default: architect
db_pass:
description: Root password to assign to the component's DB
default: secret
db_name:
description: Name of the DB the component will store content in
default: api-db
db_port:
description: Port for the db
default: 5432
api_port:
description: Port for api
default: 8080
# Below are the configured services for the React component.
# For more info - https://docs.architect.io/components/services/
services:
app:
depends_on:
# We want our app to start up after the api 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.
- api
# Build context is the location of your application relative to the architect.yml file
build:
context: ./
args:
NODE_ENV: production
# Main interface port used to help define the url in the `interfaces` block
interfaces:
main:
port: 8080
# Ingresses are used to expose the application to the API gateway, allowing
# other services and dependencies to connect to it.
# For more info - https://docs.architect.io/components/ingress-rules/
ingress:
subdomain: app
environment:
PORT: 8080
REACT_APP_API_ADDR: ${{ services.api.interfaces.http.ingress.url }}
command: npm run start
# The liveness_probe makes sure the application is healthy - if not, it will re-start the application
liveness_probe:
command: curl --fail 0.0.0.0:8080
interval: 30s
failure_threshold: 3
# The debug block is used to enable hot-reloading to make real-time changes to an
# application while running `architect dev`. For more info, see -
# https://docs.architect.io/components/local-configuration/#hot-reloading
debug:
environment:
WDS_SOCKET_PORT: ${{ services.api.interfaces.http.ingress.port }} # Port for the react development server ws
liveness_probe:
initial_delay: 30s
command: npm run dev
build:
args:
NODE_ENV: development
volumes:
src:
# The `WORKDIR` defined in the Dockerfile (/usr/src/app) + name of source code directory (/src)
mount_path: /usr/src/app/src
# Path to source code relative to the architect.yml file (/src)
host_path: ./src
api-db:
image: postgres:12
interfaces:
database:
port: ${{ secrets.db_port }}
protocol: postgresql
environment:
POSTGRES_USER: ${{ secrets.db_user }}
POSTGRES_PASSWORD: ${{ secrets.db_pass }}
POSTGRES_DB: ${{ secrets.db_name }}
liveness_probe:
command: pg_isready -d ${{ secrets.db_name }} -U ${{ secrets.db_user }}
interval: 10s
failure_threshold: 3
api:
depends_on:
- api-db
image: registry.gitlab.com/architect-io/docker-files/sample-backend:latest
interfaces:
http:
port: ${{ secrets.api_port }}
ingress:
subdomain: api
environment:
DB_ADDR: ${{ services.api-db.interfaces.database.url }}/${{ secrets.db_name }}
DB_USER: ${{ secrets.db_user }}
DB_PASS: ${{ secrets.db_pass }}
PORT: ${{ secrets.api_port }}