-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.migration-import.yml
114 lines (103 loc) · 2.36 KB
/
docker-compose.migration-import.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
version: "3"
services:
# Postgres
database:
container_name: database
image: postgres:13.5
volumes:
- ./database:/var/lib/postgresql/data
networks:
- dna_network
environment:
POSTGRES_USER: "directus"
POSTGRES_PASSWORD: "directus"
POSTGRES_DB: "directus"
cache:
container_name: cache
image: redis:6
networks:
- dna_network
# Directus
directus:
container_name: directus
image: directus/directus:latest
ports:
- ${DIRECTUS_PORT}:${DIRECTUS_PORT}
volumes:
- ./directus/uploads:/directus/uploads
- ./directus/migrations:/directus/migrations
command:
- /bin/sh
- -c
- |
npx directus schema apply --yes ./migrations/schema.yaml
npx directus bootstrap
npx directus start
networks:
dna_network:
ipv4_address: ${DOCKER_DNA_IPV4_DIRECTUS}
depends_on:
- cache
- database
environment:
KEY: ${DIRECTUS_KEY}
SECRET: ${DIRECTUS_SECRET}
DB_CLIENT: "pg"
DB_HOST: "database"
DB_PORT: "5432"
DB_DATABASE: "directus"
DB_USER: "directus"
DB_PASSWORD: "directus"
CACHE_ENABLED: "true"
CACHE_STORE: "redis"
CACHE_REDIS: ${REDIS_URL}
CACHE_AUTO_PURGE: "true"
CACHE_PERMISSIONS: "true"
ADMIN_EMAIL: ${DIRECTUS_ADMIN_EMAIL}
ADMIN_PASSWORD: ${DIRECTUS_ADMIN_PASSWORD}
STORAGE_LOCATIONS: "s3"
STORAGE_S3_DRIVER: "s3"
STORAGE_S3_KEY: ${STORAGE_S3_KEY}
STORAGE_S3_SECRET: ${STORAGE_S3_SECRET}
STORAGE_S3_BUCKET: ${STORAGE_S3_BUCKET}
STORAGE_S3_REGION: ${STORAGE_S3_REGION}
ACCESS_TOKEN_TTL: 1d
CORS_ENABLED: "true"
# NestJS
nest:
container_name: nest
build:
context: ./nestjs
target: development
command: npm run start:dev
volumes:
- ./nestjs:/usr/src/app
- /usr/src/app/node_modules/
ports:
- ${NEST_PORT}:${NEST_PORT}
env_file:
- .env
networks:
- dna_network
depends_on:
- database
- cache
- directus
# Nginx
nginx:
build:
context: ./nginx
container_name: nginx
hostname: nginx
ports:
- "80:80"
depends_on:
- nest
networks:
- dna_network
networks:
dna_network:
ipam:
driver: default
config:
- subnet: ${DOCKER_DNA_IPV4_RANGE}