Skip to content

Commit df67c94

Browse files
Update Dockerfile to use Python 3.9 (#334)
* Update Dockerfile and add compose file. * Update Dockerfile comment. * Updated README. --------- Co-authored-by: Connor <> Co-authored-by: Jessica Tegner <[email protected]>
1 parent 08c3bdc commit df67c94

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

Dockerfile

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
# --------------------------------------------------------------------------
2-
# This is a Dockerfile to build an Ubuntu 14.04 Docker image with pypandoc
3-
# and pandoc
2+
# This is a Dockerfile to build an Debian 11 (bullseye) image with pypandoc
3+
# and pandoc, uses Python 3.9.
44
#
55
# Use a command like:
66
# docker build -t <user>/pypandoc .
77
# --------------------------------------------------------------------------
88

9-
FROM orchardup/python:2.7
10-
MAINTAINER Marc Abramowitz <[email protected]> (@msabramo)
9+
# Use Python 3.9
10+
FROM python:3.9
11+
# Not sure if this line needs updating, I think this person no longer works on the project?
12+
LABEL author Marc Abramowitz <[email protected]>
13+
# Update apt packages and install pandoc
14+
RUN apt update && apt upgrade -y && apt install pandoc -y
15+
# Update pip
16+
RUN pip install --upgrade pip
1117

12-
ENV DEBIAN_FRONTEND noninteractive
13-
ENV LC_ALL C
14-
15-
RUN apt-get update && apt-get install -y pandoc ipython
16-
ADD . pypandoc
18+
# Copy the files to container
19+
COPY . pypandoc
1720
WORKDIR pypandoc
18-
RUN python setup.py install
21+
22+
# Use pip to install the local version of pypandoc using pyproject.toml
23+
RUN pip install .
1924

2025
RUN mkdir -p /source
2126
WORKDIR /source

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ Note that for citeproc tests to pass you'll need to have [pandoc-citeproc](https
311311
* [Jesse Widner](https://github.com/jwidner) & [Dominic Thorn](https://github.com/domvwt) - Add support for lua filters
312312
* [Alex Kneisel](https://github.com/hey-thanks/) - Added pathlib.Path support to convert_file.
313313
* [Juho Vepsäläinen](https://github.com/bebraw/) - Creator and former maintainer of pypandoc
314-
314+
* [Connor](https://github.com/DisSupEng/) - Updated Dockerfile to Python 3.9 image and added docker compose file
315315

316316
## License
317317

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
services:
2+
app:
3+
image: pypandoc
4+
container_name: pypan_container
5+
build: .
6+
restart: always
7+
volumes:
8+
# Create a binding mount between the source directory on the host and the container's source code directory.
9+
# This means that any updated code will be transfered to the running container
10+
- .:/pypandoc/
11+
# This is just to keep the container running. It will allow us to use docker compose exec to go inside the container.
12+
command: tail -F ./anything

0 commit comments

Comments
 (0)