pandoc/dockerfiles

Pandoc Server in Docker

kimfucious opened this issue · 1 comments

I've got an app that produces manuscripts in Markdown.

I've been looking for a way to convert the Markdown to ePub, and I came across Pandoc, which is great.

I've written some code to test Markdown to ePub conversion in my app by sending POST requests to a Pandoc Server running on my local. The text property is a markdown file with YAML metadata.

const payload = {
    standalone: true,
    text: markdown,
    to: "epub",
};
const resp = await fetch("http://localhost:3030", {
    method: "POST",
    headers: {
        Accept: "application/json",
        "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
});

This returns some JSON with a base64 encoded string, which works for my use case.

What I'd like to do is run Pandoc Server in the cloud somewhere. I've looked at trying to get this done in a serverless function, but it's a bit of a pain.

I've looked at the Docker images, and I'm wondering if I can use one of those to setup a Pandoc Server on a cloud provider (e.g. GCP).

I've Googled and read the docs and haven't found much how to deploy Pandoc Server.

Any helpful advice would be most appreciated.