33 lines
1.2 KiB
Text
33 lines
1.2 KiB
Text
|
|
FROM node:22-alpine AS deps
|
||
|
|
WORKDIR /app
|
||
|
|
COPY package*.json ./
|
||
|
|
RUN npm ci
|
||
|
|
|
||
|
|
FROM node:22-alpine AS build
|
||
|
|
WORKDIR /app
|
||
|
|
COPY --from=deps /app/node_modules ./node_modules
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
# Ensure lethean_ui submodule stubs exist
|
||
|
|
RUN rm -rf submodules/lethean_ui 2>/dev/null; \
|
||
|
|
mkdir -p submodules/lethean_ui/src/styles && \
|
||
|
|
printf 'import React from "react";\nexport function Footer({ className }) {\n return React.createElement("footer", { className, style: { padding: "20px", textAlign: "center", color: "#888" } }, "Lethean Trade | lethean.io");\n}\n' > submodules/lethean_ui/src/index.tsx && \
|
||
|
|
printf ':root { --primary: #00d4aa; }\n' > submodules/lethean_ui/src/styles/globals.scss && \
|
||
|
|
printf '$primary: #00d4aa;\n' > submodules/lethean_ui/src/styles/variables.scss && \
|
||
|
|
printf '{ "name": "lethean_ui", "version": "0.0.1", "main": "src/index.tsx" }\n' > submodules/lethean_ui/package.json
|
||
|
|
|
||
|
|
RUN npx next build
|
||
|
|
|
||
|
|
FROM node:22-alpine
|
||
|
|
WORKDIR /app
|
||
|
|
COPY --from=build /app/.next ./.next
|
||
|
|
COPY --from=build /app/node_modules ./node_modules
|
||
|
|
COPY --from=build /app/package.json ./
|
||
|
|
COPY --from=build /app/public ./public
|
||
|
|
COPY --from=build /app/next.config.js ./
|
||
|
|
|
||
|
|
ENV NODE_ENV=production
|
||
|
|
EXPOSE 30289
|
||
|
|
|
||
|
|
CMD ["npx", "next", "start", "-p", "30289"]
|