This commit is contained in:
parent
b2e673321b
commit
cee55e5077
23
.gitea/workflows/deploy.yaml
Normal file
23
.gitea/workflows/deploy.yaml
Normal 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
20
Dockerfile
Normal 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" ]
|
||||||
Loading…
Reference in New Issue
Block a user