Skip to content

Commit

Permalink
build: add dockerfile and .dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Flaminietta committed Aug 1, 2024
1 parent 865f657 commit 26f0185
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
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

0 comments on commit 26f0185

Please sign in to comment.