Spaces:
Running
Running
Commit
β’
bca5b0d
1
Parent(s):
990bbcc
add bun dockerfile
Browse files- Dockerfile +49 -0
- README.md +11 -40
- next.config.mjs +1 -0
Dockerfile
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# syntax=docker/dockerfile:1.4
|
2 |
+
|
3 |
+
FROM oven/bun:1 AS base
|
4 |
+
|
5 |
+
# Install dependencies only when needed
|
6 |
+
FROM base AS deps
|
7 |
+
WORKDIR /app
|
8 |
+
|
9 |
+
# Install dependencies based on the preferred package manager
|
10 |
+
COPY --link package.json bun.lockb* ./
|
11 |
+
RUN bun install --frozen-lockfile
|
12 |
+
|
13 |
+
# Rebuild the source code only when needed
|
14 |
+
FROM base AS builder
|
15 |
+
WORKDIR /app
|
16 |
+
COPY --from=deps --link /app/node_modules ./node_modules
|
17 |
+
COPY --link . .
|
18 |
+
|
19 |
+
# Next.js collects completely anonymous telemetry data about general usage.
|
20 |
+
# Uncomment the following line in case you want to disable telemetry during the build.
|
21 |
+
# ENV NEXT_TELEMETRY_DISABLED 1
|
22 |
+
|
23 |
+
RUN bun run build
|
24 |
+
|
25 |
+
# Production image, copy all the files and run next
|
26 |
+
FROM base AS runner
|
27 |
+
WORKDIR /app
|
28 |
+
|
29 |
+
ENV NODE_ENV production
|
30 |
+
# Uncomment the following line in case you want to disable telemetry during runtime.
|
31 |
+
# ENV NEXT_TELEMETRY_DISABLED 1
|
32 |
+
|
33 |
+
RUN \
|
34 |
+
addgroup --system --gid 1001 nodejs; \
|
35 |
+
adduser --system --uid 1001 nextjs
|
36 |
+
|
37 |
+
COPY --from=builder --link /app/public ./public
|
38 |
+
|
39 |
+
# Automatically leverage output traces to reduce image size
|
40 |
+
COPY --from=builder --link --chown=1001:1001 /app/.next/standalone ./
|
41 |
+
COPY --from=builder --link --chown=1001:1001 /app/.next/static ./.next/static
|
42 |
+
|
43 |
+
USER nextjs
|
44 |
+
|
45 |
+
EXPOSE 3000
|
46 |
+
|
47 |
+
ENV PORT 3000
|
48 |
+
ENV HOSTNAME 0.0.0.0
|
49 |
+
CMD ["bun", "run", "server.js"]
|
README.md
CHANGED
@@ -1,40 +1,11 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
pnpm dev
|
13 |
-
# or
|
14 |
-
bun dev
|
15 |
-
```
|
16 |
-
|
17 |
-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
18 |
-
|
19 |
-
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
|
20 |
-
|
21 |
-
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
|
22 |
-
|
23 |
-
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
24 |
-
|
25 |
-
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
26 |
-
|
27 |
-
## Learn More
|
28 |
-
|
29 |
-
To learn more about Next.js, take a look at the following resources:
|
30 |
-
|
31 |
-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
32 |
-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
33 |
-
|
34 |
-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
35 |
-
|
36 |
-
## Deploy on Vercel
|
37 |
-
|
38 |
-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
39 |
-
|
40 |
-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
|
|
1 |
+
---
|
2 |
+
title: SmolPilot
|
3 |
+
emoji: π
|
4 |
+
colorFrom: indigo
|
5 |
+
colorTo: pink
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
license: mit
|
9 |
+
app_port: 3000
|
10 |
+
---
|
11 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next.config.mjs
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
/** @type {import('next').NextConfig} */
|
2 |
const nextConfig = {
|
|
|
3 |
reactStrictMode: true,
|
4 |
};
|
5 |
|
|
|
1 |
/** @type {import('next').NextConfig} */
|
2 |
const nextConfig = {
|
3 |
+
output: "standalone",
|
4 |
reactStrictMode: true,
|
5 |
};
|
6 |
|