create CI/CD pipeline
Some checks failed
Node.js CI/CD / build (push) Failing after 35s

This commit is contained in:
Görkem 2025-12-25 12:52:41 -08:00
parent b2e673321b
commit cee55e5077
3 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,23 @@
name: Node.js CI/CD
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Docker Image
run: docker build -t CyberCafe .
- name: Deploy Container
run: |
docker stop CyberCafeContainer || true
docker rm CyberCafeContainer || true
docker run -d \
--name CyberCafeContainer \
--restart always \
-p 3001:3000 \
CyberCafe

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# Specify the base image
FROM node:24
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install app dependencies
RUN npm install
# Bundle app source
COPY . .
# Expose port
EXPOSE 3000
# Start the app
CMD [ "node", "backend.js" ]

View File

@ -1 +0,0 @@
web: node backend.js