Add Dockerfile for containerized webserver

* Add "Running in Docker" subsection to README.md
This commit is contained in:
Simo Tumelius 2018-11-05 19:25:11 +02:00
parent 7a4cb5f4aa
commit e80c814053
2 changed files with 27 additions and 0 deletions

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM python:2.7-slim
COPY . ./
RUN apt-get update && \
apt-get install -y make
RUN pip install -r requirements.txt
CMD ["bash", "-c", "make serve LANG=en"]

View File

@ -51,6 +51,23 @@ Once you are happy with the result,
If you feel that the requirements for submissions is beyond your current possibilities, you may raise an [issue](https://github.com/Gadgetoid/Pinout.xyz/issues) requesting the addition of a specific board instead and we'll consider it!
## Running in Docker
The webserver can also be run in a Docker container. To do this, you first need to build the Docker image:
```bash
docker build -t pinout.xyz .
```
Next, you can start the containerized webserver:
```bash
docker run -p 5000:5000 -e PINOUT_LANG=en pinout.xyz
```
Now you can access the webserver at http://127.0.0.1:5000.
# Translating
If you would like to provide support for a language not yet in the repository you should start by duplicating the `src/en` directory to the appropriate [language-code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). For example, if you want to create a Czech translation you would create the folder `src/cs`. Note that there are no plans to support cultures (it would just get out of hand), so you can't have `src/fr-CA` (sorry!).