mirror of
https://github.com/ajvpot/meshexplorer.git
synced 2026-03-28 17:42:58 +01:00
27 lines
648 B
Docker
27 lines
648 B
Docker
# syntax=docker/dockerfile:1
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV production
|
|
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
RUN adduser --system --uid 1001 nextjs
|
|
|
|
# Install tsx globally for running TypeScript scripts
|
|
RUN npm install -g tsx@^4.20.5
|
|
|
|
# Copy package files and install dependencies
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci --production
|
|
|
|
# Copy only the necessary files for the Discord bot
|
|
COPY --chown=nextjs:nodejs src ./src
|
|
COPY --chown=nextjs:nodejs scripts ./scripts
|
|
COPY --chown=nextjs:nodejs tsconfig.json ./tsconfig.json
|
|
|
|
USER nextjs
|
|
|
|
# Default command runs the Discord bot
|
|
CMD ["tsx", "scripts/discord-bot.ts"]
|