Skip to content

Commit dd4ac22

Browse files
committed
Deploy CI CD on Test Server
1 parent aa651e6 commit dd4ac22

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ jobs:
4747
- name: Deploy to EC2
4848
run: |
4949
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ubuntu@${{ secrets.AWS_EC2_IP }} << 'EOF'
50-
docker pull ${{ secrets.DOCKER_USERNAME }}/ecommerce-backend:latest
51-
docker-compose -f /home/ubuntu/docker-compose.yml up -d
5250
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ secrets.DOCKER_USERNAME }}
5351
docker pull ${{ secrets.DOCKER_USERNAME }}/ecommerce-backend:latest
5452
docker stop ecommerce-backend || true

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ RUN python ./Backend/EcommerceInventory/manage.py collectstatic --no-input
4242

4343
# Expose port 80 (adjust as necessary)
4444
EXPOSE 80
45-
45+
WORKDIR /code/Backend/EcommerceInventory
4646
# Command to run Django server
47-
CMD ["gunicorn", "--chdir", "Backend.EcommerceInventory.EcommerceInventory.wsgi:application", "--bind", "0.0.0.0:80"]
47+
CMD ["gunicorn", "EcommerceInventory.wsgi:application", "--bind", "0.0.0.0:80"]

0 commit comments

Comments
 (0)