File size: 1,603 Bytes
90c6b42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
version: '3.8'
services:
  atom-app-test:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "3000:3000"
    depends_on:
      - postgres
    environment:
      NODE_ENV: test
      POSTGRES_HOST: postgres
      POSTGRES_PORT: 5432
      POSTGRES_DB: atom_test
      POSTGRES_USER: test_user
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-test_password_123}
      DATABASE_URL: postgresql://test_user:${POSTGRES_PASSWORD:-test_password_123}@postgres:5432/atom_test
      OPENAI_API_KEY: ${OPENAI_API_KEY}
      JWT_SECRET: ${JWT_SECRET:-test_jwt_secret_key_for_testing}
    volumes:
      - ./:/app
      - /app/node_modules
    networks:
      - atom-test-network

  postgres:
    image: postgres:15-alpine
    environment:
      POSTGRES_DB: atom_test
      POSTGRES_USER: test_user
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-test_password_123}
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./init-test-db.sql:/docker-entrypoint-initdb.d/init-test-db.sql:ro
    networks:
      - atom-test-network
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U test_user -d atom_test"]
      interval: 5s
      timeout: 5s
      retries: 5
      start_period: 30s

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    networks:
      - atom-test-network
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 30s
      timeout: 5s
      retries: 3

volumes:
  postgres_data:

networks:
  atom-test-network:
    driver: bridge