-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.tests.yaml
executable file
·114 lines (107 loc) · 2.91 KB
/
docker-compose.tests.yaml
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.8"
services:
webapp-backoffice:
image: node:20
working_dir: /app
volumes:
- ./webapp-backoffice:/app
environment:
POSTGRESQL_ADDON_URI: postgres://user:password@db:5432/jdma
NODEMAILER_HOST: mailhog
NODEMAILER_PORT: 1025
NODEMAILER_USER: null
NODEMAILER_PASSWORD: null
NODEMAILER_FROM: "Équipe JDMA [email protected]"
NODEMAILER_BASEURL: http://localhost:3000
NEXTAUTH_SECRET: secretauth
NEXTAUTH_URL: http://localhost:3000
JWT_SECRET: mysecret
JWT_SIGNING_KEY: mykey
JWT_ENCRYPTION_KEY: myencryptionkey
JWT_ENCRYPTION_ALGORITHM: HS512
JWT_EXPIRATION_TIME: 2592000
NEXT_PUBLIC_BO_APP_URL: http://localhost:3000
ES_ADDON_URI: https://localhost:9200
ES_ADDON_USER: "elastic"
ES_ADDON_PASSWORD: "ES_ADDON_PASSWORD"
command: sh -c "npx prisma generate && yarn build && npx prisma migrate reset --force && yarn start"
depends_on:
db:
condition: service_healthy
ports:
- "3000:3000"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/ || exit 1"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
networks:
- jdma-network
webapp-form:
image: node:20
working_dir: /app
volumes:
- ./webapp-form:/app
environment:
POSTGRESQL_ADDON_URI: postgres://user:password@db:5432/jdma
NODEMAILER_HOST: mailhog
NODEMAILER_PORT: 1025
command: sh -c "yarn install && yarn build && npx prisma generate && yarn startB"
depends_on:
db:
condition: service_healthy
ports:
- "3001:3001"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3001/ || exit 1"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
networks:
- jdma-network
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: jdma
volumes:
- pg_data:/var/lib/postgresql/data
ports:
- "5555:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d jdma"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
networks:
- jdma-network
mailhog:
image: mailhog/mailhog:latest
ports:
- "8025:8025" # Interface web de MailHog
- "1025:1025" # SMTP
networks:
- jdma-network
# Service pour reset et reseed la base de données
db-reset:
image: node:20
working_dir: /app
volumes:
- ./webapp-backoffice:/app
environment:
POSTGRESQL_ADDON_URI: postgres://user:password@db:5432/jdma
command: sh -c "npx prisma migrate reset --force --skip-generate --skip-seed && npx prisma db seed"
depends_on:
db:
condition: service_healthy
networks:
- jdma-network
volumes:
pg_data:
networks:
jdma-network:
name: jdma-network