Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/depoly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy Backend to AWS
on:
push:
branches:
- main
- development

jobs:
deploy:
Expand All @@ -21,5 +21,7 @@ jobs:
key: ${{ secrets.AWS_SSH_KEY }}
script: |
cd ~/Auto-Ledger
git pull origin main
docker compose up -d --build backend
git fetch origin
git reset --hard origin/development
docker compose build --no-cache backend
docker compose up -d backend
16 changes: 6 additions & 10 deletions backend/nest-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
# Base image
FROM node:20-alpine
FROM node:20-slim

RUN apt-get update -y && apt-get install -y openssl

# Create app directory
WORKDIR /usr/src/app

# Copy dependency definitions
COPY package*.json ./

# Install dependencies (only production for smaller size, but let's keep all for now to be safe)
RUN npm install

# Copy all files (including the dist folder we will build locally)
COPY . .

# Generate Prisma Client
RUN npx prisma generate

# Expose port
RUN npm run build

EXPOSE 3000

# Start the application using the local dist folder
CMD [ "npm", "run", "start:prod" ]
CMD [ "npm", "run", "start" ]
Loading
Loading