2
2
FROM node:18 as build-stage
3
3
4
4
# Set working directory for frontend
5
- WORKDIR /code
5
+ WORKDIR /app/frontend
6
6
7
7
# Copy frontend package files
8
- COPY ./Frontend/ecommerce_inventory/package.json ./Frontend/ecommerce_inventory/package-lock.json /code/
9
-
10
- # List contents (optional, for verification)
11
- RUN ls -l /code
8
+ COPY ./Frontend/ecommerce_inventory/package.json ./Frontend/ecommerce_inventory/package-lock.json ./
12
9
13
10
# Install frontend dependencies
14
11
RUN npm install
15
12
16
13
# Copy frontend source code
17
- COPY ./Frontend/ecommerce_inventory /code/
18
- COPY ./Frontend/ /code/Frontend/
19
-
20
- # List contents (optional, for verification)
21
- RUN ls -l /code
14
+ COPY ./Frontend/ecommerce_inventory .
22
15
23
16
# Build frontend (adjust this based on your React build process)
24
17
RUN npm run build
@@ -34,26 +27,16 @@ ENV PYTHONUNBUFFERED 1
34
27
WORKDIR /code
35
28
36
29
# Copy backend requirements file
37
- COPY ./Backend/EcommerceInventory/requirements.txt /code/
38
-
39
- # List contents (optional, for verification)
40
- RUN ls -l /code
30
+ COPY ./Backend/EcommerceInventory/requirements.txt .
41
31
42
32
# Install backend dependencies
43
33
RUN pip install -r requirements.txt
44
34
45
35
# Copy built frontend to Django static files directory
46
- COPY --from=build-stage /code/build /code/static/
47
-
48
- # List contents (optional, for verification)
49
- RUN ls -l /code/static
36
+ COPY --from=build-stage /app/frontend/build ./static
50
37
51
38
# Copy Django project files
52
- COPY ./Backend/EcommerceInventory /code/
53
- COPY ./Frontend/ /code/Frontend/
54
-
55
- # List contents (optional, for verification)
56
- RUN ls -l /code
39
+ COPY ./Backend/EcommerceInventory .
57
40
58
41
# Collect static files
59
42
RUN python manage.py collectstatic --no-input
0 commit comments