forked from pawelmalak/snippet-box
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
43 lines (31 loc) · 760 Bytes
/
Dockerfile.dev
File metadata and controls
43 lines (31 loc) · 760 Bytes
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
# Multi-stage Dockerfile para desarrollo
# Backend stage
FROM node:16-alpine AS backend
WORKDIR /app
# Install backend dependencies
COPY package*.json ./
RUN npm install
# Install nodemon globally for hot reload
RUN npm install -g nodemon ts-node
# Copy source code (excluding client)
COPY src/ ./src/
COPY tsconfig.json ./
COPY nodemon.json ./
# Create data directory
RUN mkdir -p ./data
EXPOSE 5000
# Default command
CMD ["npm", "run", "dev:server"]
# Frontend stage
FROM node:16-alpine AS frontend
WORKDIR /app
# Install frontend dependencies
COPY client/package*.json ./
RUN npm install
# Copy client source
COPY client/src/ ./src/
COPY client/public/ ./public/
COPY client/tsconfig.json ./
EXPOSE 3000
# Default command
CMD ["npm", "start"]