Skip to content

Commit f548609

Browse files
committed
DZ3th docker CI
0 parents  commit f548609

401 files changed

Lines changed: 61819 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Docker CI Demo
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
tags:
8+
- '**'
9+
10+
jobs:
11+
push:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Docker meta
19+
id: docker_meta
20+
uses: crazy-max/ghaction-docker-meta@v1
21+
with:
22+
images: leecloudo/nodejs-ci
23+
tag-semver: |
24+
{{version}}
25+
{{major}}.{{minor}}
26+
27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v2
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v2
32+
33+
- name: Login to Docker Hub
34+
uses: docker/login-action@v2
35+
with:
36+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
37+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
38+
39+
- name: Build and push Docker Image
40+
uses: docker/build-push-action@v4
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.docker_meta.outputs.tags }}
45+
labels: ${{ steps.docker_meta.outputs.labels }}

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use an official Node.js runtime as the base image
2+
FROM node:20-alpine
3+
4+
# Set the working directory in the container
5+
WORKDIR /usr/src/app
6+
7+
# Copy package.json and package-lock.json to the working directory
8+
COPY package*.json ./
9+
10+
# Install project dependencies
11+
RUN npm install
12+
13+
# Copy the rest of the application code
14+
COPY . .
15+
16+
# Expose the application port
17+
EXPOSE 3000
18+
19+
# Start the application
20+
CMD ["node", "server.js"]

0 commit comments

Comments
 (0)