Skip to content

Instantly share code, notes, and snippets.

@rfay
Last active April 25, 2023 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfay/bac466b3ec17bf4ac602092617f61416 to your computer and use it in GitHub Desktop.
Save rfay/bac466b3ec17bf4ac602092617f61416 to your computer and use it in GitHub Desktop.
Experimental gotenberg
services:
gotenberg:
container_name: ddev-${DDEV_SITENAME}-gotenberg
command: "bash -c 'mkcert -install && gotenberg --chromium-ignore-certificate-errors'"
# Add a build stage so we can add mkcert, etc.
build:
context: gotenberg
environment:
- DISABLE_UNOCONV=1
# These will put the https port exposed as 3000, the http port exposed as 3001
- HTTP_EXPOSE=3001:3000
- HTTPS_EXPOSE=3000:3000
- MAXIMUM_WAIT_TIMEOUT=180
- VIRTUAL_HOST=$DDEV_HOSTNAME
- GOOGLE_CHROME_IGNORE_CERTIFICATE_ERRORS=1
- LOG_LEVEL=DEBUG
expose:
- 3000
external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
image: gotenberg/gotenberg:latest
labels:
com.ddev.approot: $DDEV_APPROOT
com.ddev.site-name: ${DDEV_SITENAME}
restart: 'no'
volumes:
- .:/mnt/ddev_config
# ddev-global-cache gets mounted so we have the CAROOT
- ddev-global-cache:/mnt/ddev-global-cache
web:
links:
- gotenberg
FROM gotenberg/gotenberg
# CAROOT for mkcert to use, has the CA config
ENV CAROOT=/mnt/ddev-global-cache/mkcert
# If used on mac M1, the target platform will need to be adjustable
ARG TARGETPLATFORM=linux/arm64
USER root
RUN apt update && apt install -y inetutils-ping less procps sudo
RUN echo "gotenberg ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/gotenberg && chmod 0440 /etc/sudoers.d/gotenberg
RUN mkdir -p /usr/local/bin && curl --fail -JL -s -o /usr/local/bin/mkcert "https://dl.filippo.io/mkcert/latest?for=${TARGETPLATFORM}"
RUN chmod +x /usr/local/bin/mkcert
USER gotenberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment