-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchitect.yml
More file actions
84 lines (82 loc) · 2.71 KB
/
Copy patharchitect.yml
File metadata and controls
84 lines (82 loc) · 2.71 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
name: nodejs
description: |
Example component that includes a NodeJS server that renders templates
and allows creation of items in a database
homepage: https://github.com/architect-templates/nodejs
keywords:
- architect
- examples
- postgres
- express
- nodejs
# Add secrets to be used by different services. For more information:
# https://docs.architect.io/deployments/secrets/
secrets:
db_user:
description: Root user to assign to the component's database
default: architect
db_pass:
description: Root password to assign to the component's database
default: secret
db_name:
description: Name of the database the component will store content in
default: app-db
db_port:
description: Port for the database
default: 5432
app_port:
description: Port the app accepts connections on
default: 8080
services:
### This service is the actual Node.js component ###
app:
# Build context is the location of your application relative to the architect.yml file
build:
context: .
depends_on:
- database
interfaces:
main:
port: ${{ secrets.app_port }}
ingress:
subdomain: app
# The liveness_probe makes sure the application is healthy - if not, it will re-start the application
liveness_probe:
command: curl --fail localhost:8080
interval: 5s
failure_threshold: 3
# Set environment variables for your application here
environment:
DB_ADDR: ${{ services.database.interfaces.main.url }}/${{ secrets.db_name }}
DB_USER: ${{ secrets.db_user }}
DB_PASS: ${{ secrets.db_pass }}
PORT: ${{ secrets.app_port }}
# 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:
command: npm run dev
build:
args:
NODE_ENV: development
volumes:
src:
# The `WORKDIR` defined in the Dockerfile (/usr/src/app) + src
mount_path: /usr/src/app/src
# Path to source code relative to the architect.yml file
host_path: ./src
# Database service
database:
image: postgres:12
interfaces:
main:
port: ${{ secrets.db_port }}
protocol: postgresql
liveness_probe:
command: pg_isready -d ${{ secrets.db_name }} -U ${{ secrets.db_user }}
interval: 3s
failure_threshold: 3
environment:
POSTGRES_USER: ${{ secrets.db_user }}
POSTGRES_PASSWORD: ${{ secrets.db_pass }}
POSTGRES_DB: ${{ secrets.db_name }}