forked from coracle/flotilla
Fix dockerfile again
This commit is contained in:
@@ -4,7 +4,6 @@ ios
|
|||||||
build
|
build
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
.git
|
|
||||||
.gitignore
|
.gitignore
|
||||||
|
|
||||||
# Env files (keep .env for build; exclude local overrides)
|
# Env files (keep .env for build; exclude local overrides)
|
||||||
|
|||||||
+12
-25
@@ -1,40 +1,27 @@
|
|||||||
# Stage 1: Build
|
# Build and run the Flotilla web server.
|
||||||
# Uses .env from build context for config (logo, branding, etc.)
|
#
|
||||||
# Optional: docker build --build-arg VITE_BUILD_HASH=$(git rev-parse --short HEAD) -t flotilla .
|
# docker build -t flotilla .
|
||||||
|
# docker run -p 3000:3000 flotilla
|
||||||
|
#
|
||||||
|
# Pass --build-arg VITE_BUILD_HASH=$(git rev-parse --short HEAD) to stamp the build.
|
||||||
|
# A .env in the build context is picked up by build.sh for branding config.
|
||||||
|
|
||||||
FROM node:22-bookworm AS builder
|
FROM node:22-bookworm
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends curl
|
|
||||||
|
|
||||||
RUN npm install -g pnpm@10.33.0
|
RUN npm install -g pnpm@10.33.0
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
RUN pnpm i
|
|
||||||
|
|
||||||
# Copy everything (including .env when present) - build.sh will source it
|
RUN pnpm i --frozen-lockfile
|
||||||
COPY . .
|
|
||||||
|
|
||||||
ARG VITE_BUILD_HASH
|
|
||||||
ENV VITE_BUILD_HASH=${VITE_BUILD_HASH}
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS=--max_old_space_size=16384
|
ENV NODE_OPTIONS=--max_old_space_size=16384
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
FROM node:22-alpine
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Install production dependencies needed by the Node server runtime
|
|
||||||
RUN npm install -g pnpm@10.33.0
|
|
||||||
COPY package.json pnpm-lock.yaml ./
|
|
||||||
RUN pnpm i --prod --frozen-lockfile --ignore-scripts
|
|
||||||
|
|
||||||
# Copy only the built output and server source - no app source, no .env, no dev deps
|
|
||||||
COPY --from=builder /app/build ./build
|
|
||||||
COPY --from=builder /app/server.js ./server.js
|
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|||||||
Reference in New Issue
Block a user