Skip to content

Commit

Permalink
Add initial Docker setup. (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha authored Feb 10, 2023
1 parent 67543f0 commit 6c18e93
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:22.10

# build-essential is needed for building the C++ code in the PPAFM package

RUN apt-get update --yes && \
apt-get install --yes --no-install-recommends \
build-essential \
python3 \
python3-pip \
python-is-python3 && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN useradd -ms /bin/bash ppafm-user

RUN mkdir /exec && chown ppafm-user:ppafm-user /exec

USER ppafm-user

WORKDIR /home/ppafm-user

RUN pip install --upgrade --user pip && pip cache purge

COPY --chown=ppafm-user:ppafm-user ./ ppafm

RUN pip install -e ppafm/ && pip cache purge


ENV PATH="${PATH}:/home/ppafm-user/ppafm/"

WORKDIR /exec
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,22 @@ Hover the mouse cursor over any parameter for a tooltip explaining the meaning o
* [Prokop Hapala, Georgy Kichin, Christian Wagner, F. Stefan Tautz, Ruslan Temirov, and Pavel Jelínek, Mechanism of high-resolution STM/AFM imaging with functionalized tips, Phys. Rev. B 90, 085421 – Published 19 August 2014](http://journals.aps.org/prb/abstract/10.1103/PhysRevB.90.085421)
* [Prokop Hapala, Ruslan Temirov, F. Stefan Tautz, and Pavel Jelínek, Origin of High-Resolution IETS-STM Images of Organic Molecules with Functionalized Tips, Phys. Rev. Lett. 113, 226101 – Published 25 November 2014,](http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.113.226101)

## Making ppafm platform-independent.

We propose to use [Docker](https://docs.docker.com/get-docker/) to make the code platform-independent.

Here are the steps to build and run the ppafm Docker container:

1. Build the image.

```bash
$ docker build -t ppafm:latest .
```
2. Execute the container.

```bash
$ docker run --rm -it -v ${PWD}:/exec ppafm:latest <ppafm command>
```

### License
MIT
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ requires-python = ">=3.6"
dependencies = [
"ase",
"matplotlib",
"numpy",
"pyopencl",
"numpy<=1.21.6", # Remove upper limit when #76 is fixed.
"reikna",
]

[project.urls]
Homepage = "https://github.com/Probe-Particle/ProbeParticleModel"

[project.optional-dependencies]
opencl = ["pyopencl"]
dev = [
"pre-commit",
"pytest",
Expand Down

0 comments on commit 6c18e93

Please sign in to comment.