Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ coverage
.env
.env.local
.env.*.local
.env.*

/src/generated/prisma
15 changes: 12 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ name: coverit
services:
api:
image: ghcr.io/coveritlabs/coverit-api:${API_TAG:-dev}
build:
context: ${API_DIR}
secrets:
- npm_token
pull_policy: always
container_name: coverit-api
ports:
- "3000:3000"
environment:
- NODE_ENV=${NODE_ENV:-development}
- PORT=3000
- DATABASE_URL=postgresql://${DB_USER:-postgres}:${DB_PASSWORD:-postgres}@db:5432/${DB_NAME:-coverit}?schema=public
- REDIS_URL=redis://redis:6379
- JWT_SECRET=${JWT_SECRET:-change-me-in-production}
- DATABASE_URL=${DATABASE_URL:-}
- REDIS_URL=${REDIS_URL:-}
- JWT_SECRET=${JWT_SECRET:-}
- JWT_ACCESS_EXPIRY=${JWT_ACCESS_EXPIRY:-15m}
- JWT_REFRESH_EXPIRY_SECONDS=${JWT_REFRESH_EXPIRY_SECONDS:-604800}
- RESET_TOKEN_TTL_SECONDS=${RESET_TOKEN_TTL_SECONDS:-900}
Expand All @@ -28,6 +32,7 @@ services:
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID:-}
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-}
- GITHUB_CALLBACK_URL=${GITHUB_CALLBACK_URL:-http://localhost:3000/api/v1/auth/oauth/github/callback}
- NODE_TLS_REJECT_UNAUTHORIZED=0
restart: unless-stopped
depends_on:
db:
Expand Down Expand Up @@ -66,6 +71,10 @@ services:
retries: 5
restart: unless-stopped

secrets:
npm_token:
environment: GITHUB_TOKEN

volumes:
postgres_data:
redis_data:
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
testMatch: ['**/__tests__/**/*.test.ts'],
moduleFileExtensions: ['ts', 'js', 'json'],
moduleNameMapper: {
'^ioredis$': '<rootDir>/src/__tests__/mocks/ioredis.ts',
'^@api/(.*)$': '<rootDir>/src/api/$1',
'^@config/(.*)$': '<rootDir>/src/config/$1',
'^@lib/(.*)$': '<rootDir>/src/lib/$1',
Expand Down
5 changes: 0 additions & 5 deletions overrides/api.cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,4 @@

services:
api:
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- JWT_SECRET=${JWT_SECRET}
depends_on: []
13 changes: 1 addition & 12 deletions overrides/api.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,10 @@ services:
api:
image: coverit-api-dev-local
build:
context: ${API_DIR}
dockerfile: Dockerfile.dev
secrets:
- npm_token
volumes:
- ${API_DIR}/src:/app/src
- ${API_DIR}/prisma:/app/prisma
- ${API_DIR}/prisma.config.ts:/app/prisma.config.ts
- ${API_DIR}/nodemon.json:/app/nodemon.json
- ${API_DIR}/tsconfig.json:/app/tsconfig.json
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://postgres:postgres@db:5432/coverit_dev?schema=public
- JWT_SECRET=dev-secret-do-not-use-in-production

secrets:
npm_token:
environment: GITHUB_TOKEN
- ${API_DIR}/tsconfig.json:/app/tsconfig.json
9 changes: 1 addition & 8 deletions overrides/api.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,4 @@ services:
api:
image: coverit-api-test-local
build:
context: ${API_DIR}
dockerfile: Dockerfile
secrets:
- npm_token

secrets:
npm_token:
environment: GITHUB_TOKEN
dockerfile: Dockerfile
Loading
Loading