OhMyDitzzy commited on
Commit ·
ec01417
1
Parent(s): 70399bd
anything
Browse files- Dockerfile +3 -3
- src/server/router.ts +1 -1
Dockerfile
CHANGED
|
@@ -2,7 +2,6 @@ FROM oven/bun:1-alpine
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Copy package files
|
| 6 |
COPY package*.json ./
|
| 7 |
COPY tsconfig*.json ./
|
| 8 |
COPY vite.config.ts ./
|
|
@@ -15,10 +14,11 @@ COPY public ./public
|
|
| 15 |
|
| 16 |
RUN bun install vite @vitejs/plugin-react && bun run build
|
| 17 |
|
| 18 |
-
RUN bun build src/server/index.ts --outdir dist --target bun
|
| 19 |
|
| 20 |
EXPOSE 7860
|
| 21 |
ENV PORT=7860
|
| 22 |
ENV NODE_ENV=production
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
COPY package*.json ./
|
| 6 |
COPY tsconfig*.json ./
|
| 7 |
COPY vite.config.ts ./
|
|
|
|
| 14 |
|
| 15 |
RUN bun install vite @vitejs/plugin-react && bun run build
|
| 16 |
|
| 17 |
+
RUN bun build src/server/index.ts --outdir server-dist --target bun
|
| 18 |
|
| 19 |
EXPOSE 7860
|
| 20 |
ENV PORT=7860
|
| 21 |
ENV NODE_ENV=production
|
| 22 |
|
| 23 |
+
# Run server dari folder berbeda
|
| 24 |
+
CMD ["bun", "run", "server-dist/index.js"]
|
src/server/router.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import { join } from "path";
|
| 2 |
|
| 3 |
// Serve static files from dist/public
|
| 4 |
-
const publicDir = join(process.cwd(), "dist");
|
| 5 |
|
| 6 |
export async function router(req: Request): Promise<Response> {
|
| 7 |
const url = new URL(req.url);
|
|
|
|
| 1 |
import { join } from "path";
|
| 2 |
|
| 3 |
// Serve static files from dist/public
|
| 4 |
+
const publicDir = join(process.cwd(), "dist", "public");
|
| 5 |
|
| 6 |
export async function router(req: Request): Promise<Response> {
|
| 7 |
const url = new URL(req.url);
|