docker-compose.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. version: '3.8'
  2. services:
  3. app:
  4. build:
  5. context: .
  6. dockerfile: Dockerfile
  7. args:
  8. # Update 'VARIANT' to pick an LTS version of Node.js: 16, 14, 12.
  9. # Append -bullseye or -buster to pin to an OS version.
  10. # Use -bullseye variants on local arm64/Apple Silicon.
  11. VARIANT: 16-bullseye
  12. volumes:
  13. - ..:/workspace
  14. - wiki-vscode-ext:/root/.vscode-server/extensions
  15. # Overrides default command so things don't shut down after the process ends.
  16. command: sleep infinity
  17. # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
  18. network_mode: service:db
  19. # Uncomment the next line to use a non-root user for all processes.
  20. # user: node
  21. # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
  22. # (Adding the "ports" property to this file will not forward from a Codespace.)
  23. db:
  24. image: postgres:latest
  25. restart: unless-stopped
  26. volumes:
  27. - postgres-data:/var/lib/postgresql/data
  28. environment:
  29. POSTGRES_PASSWORD: postgres
  30. POSTGRES_USER: postgres
  31. POSTGRES_DB: postgres
  32. pgadmin:
  33. image: dpage/pgadmin4:latest
  34. environment:
  35. - PGADMIN_DEFAULT_EMAIL=dev@js.wiki
  36. - PGADMIN_DEFAULT_PASSWORD=123123
  37. - PGADMIN_DISABLE_POSTFIX=True
  38. - PGADMIN_LISTEN_PORT=8000
  39. - PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
  40. network_mode: service:db
  41. # volumes:
  42. # - ./pgadmin-servers.json:/pgadmin4/servers.json
  43. volumes:
  44. postgres-data:
  45. wiki-vscode-ext: