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

build: dockerize promcda #46

Merged
merged 1 commit into from
Aug 1, 2024
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
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.ipynb_checkpoints/
__pycache__
*.pyc
*.pyo
*.pyd
env/
venv/
.idea/
.vscode/
*.git
*.gitignore
.DS_Store
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Install the package
RUN pip install .

# Make port 80 available to the world outside this container
EXPOSE 80

# Run the command to start your package
CMD ["python3", "-m", "mcda.mcda_run", "-c", "configuration.json"]
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pip install -r requirements.txt
The Python version should de 3.9 or higher.

### Running ProMCDA
From the root dir,
From the root dir, via command line
- on Windows:
```bash
activate.bat <your-env>
Expand All @@ -222,6 +222,22 @@ python3 -m mcda.mcda_run -c configuration.json
```
where an example of configuration file can be found in `./configuration.json`.

We tested ProMCDA on Windows, Linux and Mac. We identified a possible issue with some Windows machines caused by the
library ```kaleido``` (used to generate static images) and reported [here](https://github.com/plotly/Kaleido/issues/126).
If you are experiencing any unexpected behavior of the package, we provide to you also the possibility to run it via Docker.

First, build the docker image:
```bash
docker build -t <your-docker-image> .
```

Then, run the Docker container:
```bash
docker run -p 4000:80 <your-docker-image>
```

Change the configuration file for your needs.

### Running the tests
```bash
python3 -m pytest -s tests/unit_tests -vv
Expand Down
Loading