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

📝 Added Docker hot reload #317

Merged
merged 3 commits into from
Mar 14, 2024
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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ NEXT_PUBLIC_STYTCH_PROJECT_ID="project-test"
NEXT_PUBLIC_STYTCH_SECRET="example"
NEXT_PUBLIC_STYTCH_PROJECT_ENV="test"
NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN="public-token-test"

NEXT_PUBLIC_WEBAPP_DOMAIN="http://localhost"

# ================================================
# Minio (s3 file storage)
Expand Down
2 changes: 1 addition & 1 deletion apps/client-ts/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ WORKDIR /app
RUN pnpm add -g turbo

# Start the Webapp
CMD cd apps/webapp && pnpm install && pnpm run dev --host
CMD cd apps/client-ts && pnpm install && pnpm run dev
4 changes: 2 additions & 2 deletions apps/client-ts/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Toaster } from "@/components/ui/sonner"
const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Panora",
description: "Unfied API",
};

export default function RootLayout({
Expand Down
13 changes: 11 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
interval: 10s
timeout: 5s
retries: 10
retries: 1000 # Try launching the API service as long as possible. Required for other services to start

redis:
image: "redis:7.2.3-alpine"
Expand All @@ -84,10 +84,19 @@ services:
args:
VITE_BACKEND_DOMAIN: ${VITE_BACKEND_DOMAIN}
VITE_FRONTEND_DOMAIN: ${VITE_FRONTEND_DOMAIN}
environment:
NEXT_PUBLIC_STYTCH_SECRET: ${NEXT_PUBLIC_STYTCH_SECRET}
NEXT_PUBLIC_STYTCH_PROJECT_ID: ${NEXT_PUBLIC_STYTCH_PROJECT_ID}
NEXT_PUBLIC_DISTRIBUTION: ${DISTRIBUTION}
NEXT_PUBLIC_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN: ${NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN}
NEXT_PUBLIC_STYTCH_PROJECT_ENV: ${NEXT_PUBLIC_STYTCH_PROJECT_ENV}
NEXT_PUBLIC_FRONTEND_DOMAIN: ${NEXT_PUBLIC_FRONTEND_DOMAIN}
NEXT_PUBLIC_WEBAPP_DOMAIN: ${NEXT_PUBLIC_WEBAPP_DOMAIN}
restart:
unless-stopped
ports:
- 80:5173
- 80:3000
depends_on:
api:
condition: service_healthy
Expand Down
1 change: 1 addition & 0 deletions docker-compose.source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ services:
NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN: ${NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN}
NEXT_PUBLIC_DISTRIBUTION: ${DISTRIBUTION}
NEXT_PUBLIC_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
NEXT_PUBLIC_WEBAPP_DOMAIN: "http://localhost:3000"
restart: unless-stopped
ports:
- 80:3000
Expand Down
36 changes: 18 additions & 18 deletions docs/open-source/contributors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ We made a docker file that builds Panora from sources, specifically to help you

<Steps>

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

<Step title="Removed previously installed dependencies">
<Step title="Copy env variables">
```bash
rm -rf node_modules .pnpm-store ./packages/api/dist ./packages/api/node_modules ./apps/webapp/node_modules ./apps/frontend_snippet/node_modules
cp .env.example .env
```
</Step>
</Step>

<Step title="Mac Users only:">
```bash
echo -e "node-linker=hoisted\npackage-import-method=clone-or-copy" > .npmrc
```
</Step>
<Step title="Removed previously installed dependencies">
```bash
rm -rf node_modules .pnpm-store ./packages/api/dist ./packages/api/node_modules ./apps/webapp/node_modules ./apps/frontend_snippet/node_modules
```
</Step>

<Step title="Start the Dockerfile">
```bash
docker compose -f docker-compose.source.yml up
<Step title="Mac Users only:">
```bash
echo -e "node-linker=hoisted\npackage-import-method=clone-or-copy" > .npmrc
```
</Step>

<Step title="Start the Dockerfile">
```bash
docker compose -f docker-compose.dev.yml up
```

That's all! You can find the backend and other services running at their usual location. Editing code locally will immediately reflect.
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
Loading