Skip to content

Commit

Permalink
🧱 Adding authentication to Redis Service
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachid F committed Apr 18, 2024
1 parent 143fe22 commit 4a1e1e1
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 9 deletions.
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ ENV=dev
DISTRIBUTION=selfhosted
OAUTH_REDIRECT_BASE=http://localhost:3000
SENTRY_DSN=

# ================================================
# REDIS
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASS=A3vniod98Zbuvn9u5
# ================================================

# ================================================
# Database
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ redis_data
.DS_Store
.pnpm-store/
.npmrc
.vscode
18 changes: 15 additions & 3 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ services:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}?ssl=false
DISTRIBUTION: ${DISTRIBUTION}
JWT_SECRET: ${JWT_SECRET}
REDIS_HOST: redis
REDIS_HOST: ${REDIS_HOST}
REDIS_PASS: ${REDIS_PASS}
REDIS_PORT: ${REDIS_PORT}
ENCRYPT_CRYPTO_SECRET_KEY: ${ENCRYPT_CRYPTO_SECRET_KEY}
HUBSPOT_CRM_CLOUD_CLIENT_ID: ${HUBSPOT_CRM_CLOUD_CLIENT_ID}
HUBSPOT_CRM_CLOUD_CLIENT_SECRET: ${HUBSPOT_CRM_CLOUD_CLIENT_SECRET}
Expand Down Expand Up @@ -126,9 +128,10 @@ services:

redis:
image: valkey/valkey:7.2-alpine
container_name: "Redis"
container_name: 'Redis'
command: valkey-server --requirepass ${REDIS_PASS}
ports:
- "6379:6379"
- '${REDIS_PORT}:${REDIS_PORT}'
volumes:
- ./redis-data:/data
networks:
Expand Down Expand Up @@ -179,6 +182,15 @@ services:
- frontend
volumes:
- .:/app

docs:
build:
dockerfile: ./Dockerfile.dev
context: ./docs/
ports:
- 911:3000
volumes:
- ./docs/:/app

networks:
frontend:
Expand Down
7 changes: 5 additions & 2 deletions docker-compose.source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ services:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}?ssl=false
DISTRIBUTION: ${DISTRIBUTION}
JWT_SECRET: ${JWT_SECRET}
REDIS_HOST: redis
REDIS_HOST: ${REDIS_HOST}
REDIS_PASS: ${REDIS_PASS}
REDIS_PORT: ${REDIS_PORT}
ENCRYPT_CRYPTO_SECRET_KEY: ${ENCRYPT_CRYPTO_SECRET_KEY}
HUBSPOT_CRM_CLOUD_CLIENT_ID: ${HUBSPOT_CRM_CLOUD_CLIENT_ID}
HUBSPOT_CRM_CLOUD_CLIENT_SECRET: ${HUBSPOT_CRM_CLOUD_CLIENT_SECRET}
Expand Down Expand Up @@ -121,8 +123,9 @@ services:
redis:
image: valkey/valkey:7.2-alpine
container_name: 'Redis'
command: valkey-server --requirepass ${REDIS_PASS}
ports:
- '6379:6379'
- '${REDIS_PORT}:${REDIS_PORT}'
volumes:
- ./redis-data:/data
networks:
Expand Down
11 changes: 8 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ services:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}?ssl=false
DISTRIBUTION: ${DISTRIBUTION}
JWT_SECRET: ${JWT_SECRET}
REDIS_HOST: redis
REDIS_HOST: ${REDIS_HOST}
REDIS_PASS: ${REDIS_PASS}
REDIS_PORT: ${REDIS_PORT}
ENCRYPT_CRYPTO_SECRET_KEY: ${ENCRYPT_CRYPTO_SECRET_KEY}
HUBSPOT_CRM_CLOUD_CLIENT_ID: ${HUBSPOT_CRM_CLOUD_CLIENT_ID}
HUBSPOT_CRM_CLOUD_CLIENT_SECRET: ${HUBSPOT_CRM_CLOUD_CLIENT_SECRET}
Expand Down Expand Up @@ -113,15 +115,18 @@ services:
networks:
- backend


redis:
image: valkey/valkey:7.2-alpine
container_name: "Redis"
container_name: 'Redis'
command: valkey-server --requirepass ${REDIS_PASS}
ports:
- "6379:6379"
- '${REDIS_PORT}:${REDIS_PORT}'
volumes:
- ./redis-data:/data
networks:
- backend


magic-link-frontend:
image: panoradotdev/frontend-magic-links:selfhosted
Expand Down
15 changes: 15 additions & 0 deletions docs/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20-alpine AS base

# Set pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN pnpm add -g mintlify

WORKDIR /app

# Documentation is served on port 3000.
EXPOSE 3000

# Run Documentation
CMD mintlify dev

0 comments on commit 4a1e1e1

Please sign in to comment.