Files
AgendaPro/Dockerfile
T

33 lines
626 B
Docker

# ---- Build frontend ----
FROM node:22-slim AS web-build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# ---- Runtime ----
FROM node:22-slim
WORKDIR /app
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=3000
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
# Built frontend (vite outputs to dist/)
COPY --from=web-build /app/dist ./dist
# Server source (tsx runs TS directly in production)
COPY server ./server
COPY shared ./shared
COPY tsconfig.json ./
# Persistent SQLite data
RUN mkdir -p /app/data
VOLUME /app/data
EXPOSE 3000
CMD ["npx", "tsx", "server/index.ts"]