Skip to content

Commit

Permalink
Added mkcert to use https inside container and reorder docker-compose…
Browse files Browse the repository at this point in the history
… file
  • Loading branch information
juanjol committed Sep 26, 2024
1 parent 118cca1 commit 233c342
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
17 changes: 11 additions & 6 deletions docker-compose.unlighthouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,25 @@ services:
uid: $DDEV_UID
gid: $DDEV_GID
user: '$DDEV_UID:$DDEV_GID'
networks: [default, ddev_default]
restart: "no"
shm_size: ${UNLIGHTHOUSE_SHM_SIZE:-1gb}
cap_add:
- SYS_ADMIN
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
entrypoint: [ "/entrypoint.sh" ]
environment:
DDEV_HOSTNAME: $DDEV_HOSTNAME
NODE_EXTRA_CA_CERTS: /mnt/ddev-global-cache/mkcert/rootCA.pem
entrypoint: [ "/entrypoint.sh" ]
volumes:
- ../reports/unlighthouse:/home/$USER/reports/export
- ../tests/unlighthouse:/home/$USER/reports/config
- .:/mnt/ddev_config:ro
- ddev-global-cache:/mnt/ddev-global-cache
- ../reports/unlighthouse:/home/$USER/reports/export
- ../tests/unlighthouse:/home/$USER/reports/config
- .:/mnt/ddev_config:ro
- ddev-global-cache:/mnt/ddev-global-cache
networks: [default, ddev_default]
external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
web:
links:
- unlighthouse
3 changes: 3 additions & 0 deletions unlighthouseBuild/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ RUN apt update --fix-missing; apt install -y sudo; mkdir /etc/sudoers.d; echo "A

RUN mkdir --parents /home/$username/reports && chown --recursive $username:$username /home/$username

# Install mkcert
RUN apt update --fix-missing; apt install -y curl libnss3-tools; curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"; chmod +x mkcert-v*-linux-amd64; cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert

# Setup ddev user name and folder.
USER $username
WORKDIR /home/$username/reports
Expand Down
3 changes: 3 additions & 0 deletions unlighthouseBuild/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ if [ -n "$routerIp" ]; then
IFS=$OIFS
fi

#Adding certs
CAROOT=/mnt/ddev-global-cache/mkcert/ mkcert -install

sleep infinity

0 comments on commit 233c342

Please sign in to comment.