Skip to content

Commit 24ad701

Browse files
committed
starting the project
1 parent 59c75b1 commit 24ad701

6 files changed

Lines changed: 225 additions & 0 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "Python template",
3+
"image": "ghcr.io/amoretti31/Python-Template:latest",
4+
"workspaceFolder": "/work",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/work,type=bind"
6+
}

.github/workflows/docker_image.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and publish Docker image
2+
on:
3+
push:
4+
paths:
5+
- 'Docker/**'
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v2
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v2
23+
24+
- name: Log in to GitHub Container Registry
25+
uses: docker/login-action@v2
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Build and push Python-based image
32+
uses: docker/build-push-action@v4
33+
with:
34+
context: ./docker/
35+
push: true
36+
platforms: linux/amd64,linux/arm64
37+
tags: |
38+
ghcr.io/${{ github.repository }}:latest
39+
build-args: |
40+
PYTHON_VERSION=3.10

.gitignore

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# Virtual environment
30+
venv/
31+
ENV/
32+
env/
33+
.venv/
34+
.env/
35+
36+
# Pyre type checker
37+
.pyre/
38+
39+
# Pytest
40+
.cache/
41+
42+
# Unit test / coverage reports
43+
htmlcov/
44+
.tox/
45+
.nox/
46+
.coverage
47+
.coverage.*
48+
.cache
49+
nosetests.xml
50+
coverage.xml
51+
*.cover
52+
*.py,cover
53+
.hypothesis/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# IPython
78+
profile_default/
79+
ipython_config.py
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
Pipfile.lock
89+
90+
# poetry
91+
poetry.lock
92+
93+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
94+
__pypackages__/
95+
96+
# Celery stuff
97+
celerybeat-schedule
98+
*.pid
99+
100+
# SageMath parsed files
101+
*.sage.py
102+
103+
# Environments
104+
.env
105+
.env.*
106+
.envrc
107+
*.env
108+
*.env.*
109+
110+
# Spyder project settings
111+
.spyderproject
112+
.spyproject
113+
114+
# Rope project settings
115+
.ropeproject
116+
117+
# mkdocs documentation
118+
/site
119+
120+
# mypy
121+
.mypy_cache/
122+
.dmypy.json
123+
dmypy.json
124+
125+
# Pyre
126+
.pyre/
127+
128+
# pytype static type analyzer
129+
.pytype/
130+
131+
# Cython debug symbols
132+
cython_debug/

Docker/.dockerignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Ignore Python cache files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# Ignore virtual environment directories
6+
venv/
7+
env/
8+
9+
# Ignore log files and databases
10+
*.log
11+
*.sqlite3
12+
13+
# Ignore compiled files
14+
*.o
15+
*.so
16+
17+
# Ignore system files
18+
.DS_Store
19+
Thumbs.db
20+
21+
# Ignore Docker-related files
22+
docker-compose.override.yml
23+
Dockerfile*
24+
25+
# Ignore IDE and editor files
26+
.idea/
27+
.vscode/
28+
*.swp

Docker/dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Use the official Python image as the base image
2+
FROM python:3.10-slim
3+
4+
# Set the working directory in the container
5+
WORKDIR /app
6+
7+
# Copy the requirements file into the container
8+
COPY requirements.txt .
9+
10+
# Install the dependencies
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# Copy the rest of the application code into the container
14+
COPY . .
15+
16+
# Set the default command to run the application
17+
CMD ["python", "app.py"]

Docker/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
numpy
2+
pytest

0 commit comments

Comments
 (0)