Update repo
All checks were successful
CI Workflow / build-and-test (push) Successful in 10s
Docker Build / docker (push) Successful in 49s

This commit is contained in:
2025-08-26 00:52:47 -07:00
parent fb54fb5aff
commit 7fe3cccc90
4 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
name: Docker Build
on:
push:
branches:
- main
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to Gitea Registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.cuihang1201.synology.me -u hangpersonal --password-stdin
- name: Build Docker image
run: docker build -t gitea.cuihang1201.synology.me/hangpersonal/myapp:latest .
- name: Run Docker image
run: docker run --rm gitea.cuihang1201.synology.me/hangpersonal/myapp:latest
- name: Push Docker image
run: docker push gitea.cuihang1201.synology.me/hangpersonal/myapp:latest

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
# Base image with Python 3.10
FROM python:3.10-slim
# Set work directory inside container
WORKDIR /app
# Copy dependency file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your code
COPY . .
# Default command (can be overridden in docker run)
CMD ["python3", "main.py"]

1
main.py Normal file
View File

@@ -0,0 +1 @@
print("Hello from inside the Docker container!")

View File