-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88f2798
commit 4542d9d
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Python files | ||
__pycache__/ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
.Python | ||
db.sqlite3 | ||
/db.sqlite3 | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
.pytest_cache/ | ||
|
||
# Documentation and Tests | ||
docs/ | ||
.coverage | ||
readthedocs.yml | ||
.travis.yml | ||
Makefile | ||
|
||
# Binary and Package files | ||
*.egg-info/ | ||
*.egg | ||
dist/ | ||
build/ | ||
|
||
# VCS | ||
.git/ | ||
.gitignore | ||
.gitattributes | ||
.github/ | ||
|
||
# IDEs and Editors | ||
.vscode | ||
|
||
# Virtual environments | ||
.venv | ||
venv | ||
ENV/ | ||
env/ | ||
|
||
# Others | ||
*.log | ||
|
||
# Docker | ||
Dockerfile | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Set base image | ||
# python:latest will get the latest version of python, on linux | ||
# Get a full list of python images here: https://hub.docker.com/_/python/tags | ||
FROM python:latest | ||
|
||
# set the working directory in the container | ||
WORKDIR /RocketPy | ||
|
||
# Ensure pip is updated | ||
RUN python3 -m pip install --upgrade pip | ||
|
||
# Copy the dependencies file to the working directory | ||
COPY requirements.txt . | ||
COPY requirements-tests.txt . | ||
|
||
# Install dependencies | ||
# Use a single RUN instruction to minimize the number of layers | ||
RUN pip install \ | ||
-r requirements.txt \ | ||
-r requirements-tests.txt | ||
|
||
# copy the content of the local src directory to the working directory | ||
COPY . . | ||
|
||
# command to run on container start | ||
# print the operational system and the python version | ||
CMD [ "python3", "-c", "import platform;import sys; print('Python ', sys.version, ' running on ', platform.platform())" ] | ||
|
||
# Install the rocketpy package # TODO: check if I can put this in editable mode | ||
RUN pip install . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: '3.8' | ||
|
||
services: | ||
python38-linux: | ||
image: python:3.8 | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
command: bash -c "pip install . && pip install -r requirements-tests.txt && pytest && cd rocketpy && pytest --doctest-modules" | ||
logging: | ||
options: | ||
max-size: "10m" | ||
max-file: "3" | ||
|
||
python312-linux: | ||
image: python:3.12 | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
command: bash -c "pip install . && pip install -r requirements-tests.txt && pytest && cd rocketpy && pytest --doctest-modules" | ||
logging: | ||
options: | ||
max-size: "10m" | ||
max-file: "3" |