Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(do not merge): nextauth5 #2560

Closed
wants to merge 4 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
83 changes: 83 additions & 0 deletions docker-compose-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
services:
proxy:
image: ubuntu/squid:latest
ports:
- "3128:3128"
environment:
- DNS_NAMESERVERS=8.8.8.8 8.8.4.4
volumes:
- ./squid.conf:/etc/squid/squid.conf
networks:
- proxy-net
- internal

tunnel:
image: nginx:alpine
ports:
- "3000:80"
networks:
- internal
- proxy-net
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf

keep-frontend:
# platform: linux/amd64
ports:
- "3000:3000"
extends:
file: docker-compose.common.yml
service: keep-frontend-common
image: us-central1-docker.pkg.dev/keephq/keep/keep-ui:feature_proxy
environment:
- HOSTNAME=0.0.0.0
- AUTH_TYPE=NO_AUTH
- API_URL=http://keep-backend:8080
- http_proxy=http://proxy:3128
- https_proxy=http://proxy:3128
- HTTP_PROXY=http://proxy:3128
- HTTPS_PROXY=http://proxy:3128
- npm_config_proxy=http://proxy:3128
- npm_config_https_proxy=http://proxy:3128
- npm_config_strict_ssl=false
- AUTH_TYPE=AZUREAD

# volumes:
# - ./keep-ui:/app
# - /app/node_modules
# - /app/.next
depends_on:
- keep-backend
- proxy
# networks:
# - proxy-net
# - internal

keep-backend:
ports:
- "8080:8080"
extends:
file: docker-compose.common.yml
service: keep-backend-common
image: us-central1-docker.pkg.dev/keephq/keep/keep-api
environment:
- AUTH_TYPE=NO_AUTH
volumes:
- ./state:/state
networks:
- proxy-net
- internal

keep-websocket-server:
extends:
file: docker-compose.common.yml
service: keep-websocket-server-common
networks:
- internal

networks:
proxy-net:
driver: bridge
internal:
driver: bridge
internal: true
5 changes: 5 additions & 0 deletions docker/Dockerfile.tmp.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM keep-ui
# add proxychains
USER root
RUN apk update && \
apk add --no-cache proxychains --allow-untrusted
15 changes: 9 additions & 6 deletions docker/Dockerfile.ui
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


FROM node:18-alpine AS base

# Install dependencies only when needed
Expand All @@ -11,7 +9,10 @@ WORKDIR /app
# Install dependencies based on the preferred package manager
COPY package.json package-lock.json ./
RUN npm ci --noproxy registry.npmjs.org --maxsockets 1

# Copy patches directory
COPY patches ./patches
# Apply patches to installed modules
RUN npx patch-package

# Rebuild the source code only when needed
FROM base AS builder
Expand All @@ -26,9 +27,9 @@ ENV NEXT_TELEMETRY_DISABLED 1

# If using npm comment out above and use below instead
ENV API_URL http://localhost:8080
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN npm run build


# Production image, copy all the files and run next
FROM base AS runner
ARG GIT_COMMIT_HASH=local
Expand All @@ -40,7 +41,8 @@ WORKDIR /app
ENV GIT_COMMIT_HASH=${GIT_COMMIT_HASH}
ENV KEEP_VERSION=${KEEP_VERSION}


# Install proxychains
RUN apk add --no-cache proxychains-ng

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
Expand All @@ -56,6 +58,8 @@ COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY entrypoint.sh /app/entrypoint.sh
# Add the proxy-patch.js file to the image
# COPY proxy-patch.js /app/proxy-patch.js

# as per Openshift guidelines, https://docs.openshift.com/container-platform/4.11/openshift_images/create-images.html#use-uid_create-images
RUN chgrp -R 0 /app && chmod -R g=u /app
Expand All @@ -71,5 +75,4 @@ ENV PUSHER_PORT=6001
ENV PUSHER_APP_KEY=keepappkey
ENV NEXT_PUBLIC_SENTRY_DSN=https://0d4d59e3105ffe8afa27dcb95a222009@o4505515398922240.ingest.us.sentry.io/4508258058764288


ENTRYPOINT ["/app/entrypoint.sh"]
Loading
Loading