Skip to content

Commit 5ca4de7

Browse files
committed
Deploy CI CD on Test Server
1 parent c5ed2f9 commit 5ca4de7

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COPY ./Frontend/ecommerce_inventory/package.json ./Frontend/ecommerce_inventory/
1111
RUN npm install
1212

1313
# Copy frontend source code
14-
COPY ./Frontend/ecommerce_inventory .
14+
COPY ./Frontend/ecommerce_inventory ./
1515

1616
# Build frontend (adjust this based on your React build process)
1717
RUN npm run build
@@ -27,16 +27,14 @@ ENV PYTHONUNBUFFERED 1
2727
WORKDIR /code
2828

2929
# Copy backend requirements file
30-
COPY ./Backend/EcommerceInventory/requirements.txt .
31-
32-
# Install backend dependencies
30+
COPY ./Backend/EcommerceInventory/requirements.txt /code/
3331
RUN pip install -r requirements.txt
3432

3533
# Copy built frontend to Django static files directory
36-
COPY --from=build-stage /app/frontend/build ./static
34+
COPY --from=build-stage /app/frontend/build /code/static/
3735

3836
# Copy Django project files
39-
COPY ./Backend/EcommerceInventory .
37+
COPY ./Backend/EcommerceInventory /code/
4038

4139
# Collect static files
4240
RUN python manage.py collectstatic --no-input

docker-compose.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ services:
44
web:
55
build:
66
context: .
7-
dockerfile: Dockerfile
8-
command: python manage.py runserver 0.0.0.0:80
9-
volumes:
10-
- ./Backend/EcommerceInventory:/code
11-
- ./Frontend/ecommerce_inventory/build:/code/static # Assuming React build output is in /code/static
7+
dockerfile: Dockerfile # Adjust the path to your Dockerfile if necessary
8+
command: gunicorn Backend.EcommerceInventory.EcommerceInventory.wsgi:application --bind 0.0.0.0:80
129
ports:
1310
- "80:80"
14-
environment:
15-
- DEBUG=0 # Set DEBUG to 0 for production-like environments
1611
depends_on:
1712
- db
1813

0 commit comments

Comments
 (0)