Skip to content

Commit

Permalink
Merge pull request #239 from panoratech/mintlify-docs-0.2
Browse files Browse the repository at this point in the history
Mintlify docs 0.2
  • Loading branch information
rflihxyz authored Jan 20, 2024
2 parents 746d2a0 + d100260 commit 716775e
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ redis-data
redis_data
.env
.DS_Store
.pnpm-store/
27 changes: 27 additions & 0 deletions apps/frontend-snippet/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# run directly from the repo root directory
# docker build -f ./apps/frontend-snippet/Dockerfile.dev .
FROM node:20-alpine AS base
# =======================================================================
FROM base AS builder
RUN apk add --no-cache libc6-compat
RUN apk update

# Set pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

ARG VITE_BACKEND_DOMAIN
ARG VITE_ML_FRONTEND_URL
ARG VITE_FRONTEND_DOMAIN

ENV VITE_BACKEND_DOMAIN="$VITE_BACKEND_DOMAIN"
ENV VITE_FRONTEND_DOMAIN="$VITE_FRONTEND_DOMAIN"
ENV VITE_ML_FRONTEND_URL="$VITE_ML_FRONTEND_URL"

RUN corepack enable

WORKDIR /app
RUN pnpm add -g turbo

# run the ML
CMD cd apps/frontend-snippet && pnpm install && pnpm run dev --host
25 changes: 25 additions & 0 deletions apps/webapp/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# run directly from the repo root directory
# docker build -f ./apps/webapp/Dockerfile.dev .
FROM node:20-alpine AS base
# =======================================================================
FROM base AS builder
RUN apk add --no-cache libc6-compat
RUN apk update

# Set pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

ARG VITE_BACKEND_DOMAIN
ARG VITE_FRONTEND_DOMAIN

ENV VITE_BACKEND_DOMAIN="$VITE_BACKEND_DOMAIN"
ENV VITE_FRONTEND_DOMAIN="$VITE_FRONTEND_DOMAIN"

RUN corepack enable

WORKDIR /app
RUN pnpm add -g turbo

# Start the Webapp
CMD cd apps/webapp && pnpm install && pnpm run dev --host
13 changes: 10 additions & 3 deletions docs/open-source/contributors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,22 @@ We made a docker file that builds Panora from sources, specifically to help you
<Steps>
<Step title="Get the right Dockerfile:">
```bash
cp ./packages/api/scripts/docker-compose.dev.yml docker-compose-source.yml
cp ./packages/api/scripts/docker-compose.dev.yml ./
```
</Step>

<Step title="Copy env variables">
```bash
cp .env.example .env
```
</Step>


<Step title="Start the Dockerfile">
```bash
docker compose -f docker-compose-source.yml up
docker compose -f docker-compose.dev.yml up
```
That's all! You can find the backend and other services running at their usual location.
That's all! You can find the backend and other services running at their usual location. Editing code locally will immediately reflect.
</Step>
</Steps>

Expand Down
4 changes: 2 additions & 2 deletions packages/api/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FROM node:20-alpine AS base
# =======================================================================
FROM base AS builder
RUN apk add --no-cache libc6-compat
RUN apk add --no-cache libc6-compat netcat-openbsd
RUN apk update

# Set pnpm
Expand All @@ -15,5 +15,5 @@ WORKDIR /app
RUN pnpm add -g turbo

# Start API
CMD cd packages/api && pnpm install && pnpm run start:dev
CMD cd packages/api && pnpm install && npx prisma db pull && npx prisma generate && pnpm run start:dev

72 changes: 42 additions & 30 deletions packages/api/scripts/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ services:
- backend
volumes:
- .:/app

healthcheck:
test: ["CMD", "nc", "-z", "localhost", "3000"]
interval: 10s
timeout: 5s
retries: 10

redis:
image: "redis:7.2.3-alpine"
container_name: "Redis"
Expand All @@ -69,36 +74,43 @@ services:
networks:
- backend

# webapp:
# build:
# dockerfile: ./apps/webapp/Dockerfile
# context: ./
# args:
# VITE_BACKEND_DOMAIN: ${VITE_BACKEND_DOMAIN}
# VITE_FRONTEND_DOMAIN: ${VITE_FRONTEND_DOMAIN}
# restart:
# unless-stopped
# ports:
# - 80:80
# depends_on:
# - api
# networks:
# - backend
# - frontend
webapp:
build:
dockerfile: ./apps/webapp/Dockerfile.dev
context: ./
args:
VITE_BACKEND_DOMAIN: ${VITE_BACKEND_DOMAIN}
VITE_FRONTEND_DOMAIN: ${VITE_FRONTEND_DOMAIN}
restart:
unless-stopped
ports:
- 80:5173
depends_on:
api:
condition: service_healthy

volumes:
- .:/app
networks:
- backend
- frontend

# magic-link-frontend:
# build:
# dockerfile: ./apps/frontend-snippet/Dockerfile
# context: ./
# restart:
# always
# ports:
# - 81:80
# depends_on:
# - api
# networks:
# - backend
# - frontend
magic-link-frontend:
build:
dockerfile: ./apps/frontend-snippet/Dockerfile.dev
context: ./
restart:
always
ports:
- 81:5173
depends_on:
api:
condition: service_healthy
networks:
- backend
- frontend
volumes:
- .:/app

panora-store:
image: minio/minio
Expand Down

0 comments on commit 716775e

Please sign in to comment.