Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-khattab committed Feb 9, 2024
2 parents 8cb5664 + 230ca52 commit e239569
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/prevent-direct-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Enforce Policy for Main Branch

on:
push:
branches:
- main

jobs:
enforce_policy:
runs-on: ubuntu-latest
steps:
- name: Check if push is to main and force push
if: >
github.ref == 'refs/heads/main' &&
github.event_name == 'push' &&
github.event.pull_request == null &&
!contains(github.event.head_commit.message, '[force]')
run:
echo "Warning: Direct pushes to the main branch without force are not recommended. Please use pull requests for code review."
exit 1
Empty file added API TESTING/user.rest
Empty file.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20.10.0

WORKDIR /app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm", "start"]
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.8'

services:
# Node.js App
node-app:
build: .
ports:
- "3000:3000"
volumes:
- .:/app
environment:
- NODE_ENV=development
- PORT=3000
command: npm start

# PostgreSQL Database
postgres:
image: "postgres:latest"
container_name: "postgres"
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "postgres"
ports:
- "5432:5432"

0 comments on commit e239569

Please sign in to comment.