forked from amplication/amplication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.production.yml
54 lines (53 loc) · 1.86 KB
/
docker-compose.production.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
# Deploy Amplication as a production service
# This deployment includes
# - An instance of the Amplication server
# - A PostgreSQL database instance
# - A migration service to update the database schema
# - A scheduler service to trigger Amplication server update every minute
# Variables:
# - POSTGRESQL_USER - PostgreSQL user name
# - POSTGRESQL_PASSWORD - PostgreSQL user password
# - JWT_SECRET - Server secret for creating JWT tokens
# - SERVICE_JWT_SECRET - Server secret for creating JWT tokens for services
# - BCRYPT_SALT_OR_ROUNDS - Server salt for hashing passwords in the database
# - LOCAL_DISK_ROOT - Server parameter where to save artifacts (e.g. generated code) to
version: "3"
services:
postgres:
image: postgres:12
restart: always
environment:
POSTGRES_USER: ${POSTGRESQL_USER}
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
volumes:
- postgres:/var/lib/postgresql/data
app:
image: amplication/amplication
ports:
- "3000:3000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- artifacts:/artifacts
environment:
POSTGRESQL_URL: postgres://${POSTGRESQL_USER}:${POSTGRESQL_PASSWORD}@postgres:5432
JWT_SECRET: "${JWT_SECRET}"
SERVICE_JWT_SECRET: "${SERVICE_JWT_SECRET}"
BCRYPT_SALT_OR_ROUNDS: "${BCRYPT_SALT_OR_ROUNDS}"
NODE_ENV: production
CORS_ENABLE: 1
PORT: 3000
HOST: http://localhost:3000
DEFAULT_DISK: local
LOCAL_DISK_ROOT: /artifacts
CONTAINER_BUILDER_DEFAULT: docker
migrate:
image: amplication/amplication
environment:
POSTGRESQL_URL: postgres://${POSTGRESQL_USER}:${POSTGRESQL_PASSWORD}@postgres:5432
command: npm run migrate:up
scheduler:
image: amplication/scheduler
command: --request.url http://app:3000/system/update-statuses --request.method POST --schedule '* * * * *'
volumes:
postgres: ~
artifacts: ~