Skip to content

Commit 7de65c5

Browse files
committed
fixed cors errors in dockerfile
1 parent 35f5da4 commit 7de65c5

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎.github/workflows/trivy.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ jobs:
2929
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin
3030
trivy --version
3131
32-
- name: Scan IaC & Configuration (Dockerfiles & Compose)
32+
- name: Scan IaC & Configuration
3333
run: |
34-
echo "Scanning IaC and configurations..."
34+
echo "Scanning Dockerfiles, Compose, and project configurations..."
3535
trivy config --severity CRITICAL,HIGH,MEDIUM,LOW --format table .
36-
trivy config --severity CRITICAL,HIGH --exit-code 1 .
36+
if [ -d "infrastructure" ] || [ -d "terraform" ]; then
37+
echo "Scanning Terraform / IaC directory..."
38+
trivy config --severity CRITICAL,HIGH --exit-code 1 infrastructure/ || trivy config --severity CRITICAL,HIGH --exit-code 1 terraform/
39+
fi
3740
3841
- name: Scan Filesystem & Dependencies
3942
run: |

‎client/Dockerfile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ RUN npm install
99
# Copy source code
1010
COPY . .
1111

12+
# Set proper ownership and switch to non-root user
13+
RUN chown -R node:node /app
14+
USER node
15+
1216
EXPOSE 5173
1317

1418
# Start Vite dev server on all network interfaces for Docker Compose routing

‎server/Dockerfile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ RUN npx prisma generate
1515
# Build the TypeScript code
1616
RUN npm run build
1717

18+
# Set proper directory ownership and switch to non-root user
19+
RUN chown -R node:node /app
20+
USER node
21+
1822
EXPOSE 4000
1923

2024
# Run database migrations before starting the server

0 commit comments

Comments
 (0)