-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
51 lines (36 loc) · 1.03 KB
/
Dockerfile.dev
File metadata and controls
51 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Development Dockerfile
FROM node:18-alpine AS base
# Install dependencies for development
RUN apk add --no-cache libc6-compat curl
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json package-lock.json* ./
# Install all dependencies (including dev dependencies)
RUN npm ci
# Copy source code
COPY . .
# Create next.js user
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Create .next directory and set permissions
RUN mkdir -p /app/.next && chown -R nextjs:nodejs /app
# Expose port for development
EXPOSE 3000
# Set environment
ENV NODE_ENV=development
ENV NEXT_TELEMETRY_DISABLED=1
# Switch to nextjs user
USER nextjs
# Default command for web development (will be overridden in docker-compose)
CMD ["npm", "run", "dev"]
# Discord Bot development stage
FROM base AS bot
# Switch back to root to change ownership
USER root
RUN adduser --system --uid 1002 bot
RUN chown -R bot:nodejs /app
# Switch to bot user
USER bot
# Command for bot development
CMD ["npm", "run", "dev:bot"]