-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
60 lines (42 loc) · 1.4 KB
/
Dockerfile.dev
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
52
53
54
55
56
57
58
59
60
# Stage 1: Set up the backend development environment
FROM node:16-alpine as backend-dev
# Set the working directory for the backend
WORKDIR /app/backend
# Copy backend package.json and package-lock.json
COPY backend/package*.json ./
# Install backend dependencies
RUN npm install
# Copy backend source code
COPY backend/ .
# Stage 2: Set up the dashboard development environment
FROM node:20-alpine as dashboard-dev
# Set the working directory for the dashboard
WORKDIR /app/dashboard
# Copy dashboard package.json and package-lock.json
COPY dashboard/package*.json ./
# Install dashboard dependencies
RUN npm install
# Copy dashboard source code
COPY dashboard/ .
# Final stage: Combine both development environments
FROM node:20-alpine
# Install necessary tools
RUN apk update && \
apk add supervisor && \
mkdir -p /var/log/supervisor
# Set the working directories for backend and dashboard
WORKDIR /app
# Copy the backend and dashboard from previous stages
COPY --from=backend-dev /app/backend /app/backend
COPY --from=dashboard-dev /app/dashboard /app/dashboard
# Copy Supervisor configuration
COPY supervisord.dev.conf /etc/supervisord.conf
# Copy entrypoint script
COPY entrypoint.sh /usr/local/bin/
# Make entrypoint script executable
RUN chmod +x /usr/local/bin/entrypoint.sh
# Expose ports for the dashboard and backend
EXPOSE 3000
EXPOSE 5002
# Set the entrypoint
ENTRYPOINT ["entrypoint.sh"]