aboutsummaryrefslogtreecommitdiff
path: root/.devcontainer/docker-compose.yml
blob: 0e637d0f0b50814035915e5200d22c3390e35558 (plain) (blame)
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'

services:
  app:
    build: 
      context: .
      dockerfile: Dockerfile
      args:
        # On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
        USER_UID: 1000
        USER_GID: 1000

    environment:
      # port and bind info
      PORT: 3000
      BIND_ADDRESS: localhost
      TARGET_URL: http://localhost:3000

      # Volume directory for hosted files. This directory is already created and has proper permissions
      HOST_DIR: /dist

      # DB info
      MONGO_URI: mongodb://db:27017
      MONGO_DB: ao-coverage

      # App configuration
      LOG_LEVEL: info
      UPLOAD_LIMIT: 4194304
      STAGE_1: 95
      STAGE_2: 80

    volumes:
      - ..:/workspace:cached
      - node-nm:/workspace/node_modules:cached

    # Overrides default command so things don't shut down after the process ends.
    command: sleep infinity

    # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
    network_mode: service:db

    # Uncomment the next line to use a non-root user for all processes.
    user: node

    # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. 
    # (Adding the "ports" property to this file will not forward from a Codespace.)

  db:
    image: mongo:latest
    restart: unless-stopped
    volumes:
      - mongodb-data:/data/db

    # Uncomment to change startup options
    # environment:
    #  MONGO_INITDB_ROOT_USERNAME: root
    #  MONGO_INITDB_ROOT_PASSWORD: example
    #  MONGO_INITDB_DATABASE: your-database-here

    # Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally.
    # (Adding the "ports" property to this file will not forward from a Codespace.)

volumes:
  mongodb-data:
  node-nm: