Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerizes app and removes unused data #13

Merged
merged 5 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.11-slim-bookworm

EXPOSE 3000

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip3 install --no-cache-dir --upgrade -r /code/requirements.txt && \
apt-get purge -y --auto-remove && \
rm -rf /var/lib/apt/lists/*

COPY ./lib /code/lib

CMD ["gunicorn", "-w 4", "-k", "uvicorn.workers.UvicornWorker", "lib:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "120"]
4 changes: 4 additions & 0 deletions README.md
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted a "RocketPY" under "Simulating and extracting RocketPY native class" other than that @Gui-FernandesBR 's recommendation was great

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make sure to update the README and web docs accordingly in the next PR when I split the routes

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
- Performs rocket simulations and returns simulation data
- Stores simulation input data in mongo-db

## Docker
- touch .env
- docker-compose up --build -d

## Setup
- [Install python3](https://www.python.org/downloads/) 3.11.5 or above
- [install mongodb-atlas](https://www.mongodb.com/try/download/community)
Expand Down
14 changes: 0 additions & 14 deletions apprunner.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '1'

services:
fastapi-app:
build:
context: .
dockerfile: Dockerfile
image: infinity-api:latest
ports:
- "3000:3000"
env_file:
- .env
GabrielBarberini marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion lib/controllers/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MotorController():
def __init__(self, motor: Motor, motor_kind):
self.guard(motor, motor_kind)
motor_core = {
"thrust_source": f"lib/data/motors/{motor.thrust_source.value}.eng",
"thrust_source": f"lib/data/engines/{motor.thrust_source.value}.eng",
"burn_time": motor.burn_time,
"nozzle_radius": motor.nozzle_radius,
"dry_mass": motor.dry_mass,
Expand Down
199 changes: 0 additions & 199 deletions lib/data/caldene/drag.csv

This file was deleted.

Loading
Loading