Skip to content

Instantly share code, notes, and snippets.

@tuutti

tuutti/.env Secret

Last active February 3, 2022 06:15
Show Gist options
  • Save tuutti/a6b77f9fd66c5da6f39c8682ca71cdd1 to your computer and use it in GitHub Desktop.
Save tuutti/a6b77f9fd66c5da6f39c8682ca71cdd1 to your computer and use it in GitHub Desktop.
Docker setup for adnanh/webhook
WEBHOOK_SECRET=your-webhook-secret
version: '3.7'
services:
app:
container_name: "drupal-repository-webhook"
build:
context: .
dockerfile: Dockerfile
restart: always
volumes:
- .:/app:delegated
- ./hooks.json:/etc/webhook/hooks.json
env_file:
- .env
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`your-webhook-server.example.com`)"
- "traefik.http.routers.app.tls=true"
- "traefik.http.routers.app.tls.certresolver=le"
networks:
- traefik-network
nginx:
container_name: "drupal-repository-nginx"
image: nginx:alpine
restart: always
volumes:
- ./dist:/usr/share/nginx/html
networks:
- traefik-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx.rule=Host(`your-composer-repository.example.com`)"
- "traefik.http.services.nginx.loadbalancer.server.port=8080"
- "traefik.http.routers.nginx.tls=true"
- "traefik.http.routers.nginx.tls.certresolver=le"
networks:
traefik-network:
external: true
internal:
external: false
FROM alpine:3.14
COPY --from=almir/webhook /usr/local/bin/webhook /usr/local/bin/webhook
# We need php and git to build satis.
RUN apk add --no-cache git php8 php8-openssl php8-common php8-json php8-phar php8-mbstring make ; \
ln -s /usr/bin/php8 /usr/bin/php
ENV COMPOSER_HOME=/.composer
COPY --from=composer:2.2 /usr/bin/composer /usr/local/bin/
RUN \
# COMPOSER_HOME permissions.
mkdir -p $COMPOSER_HOME && \
chmod -R a+rwx $COMPOSER_HOME
WORKDIR /etc/webhook
VOLUME ["/etc/webhook"]
EXPOSE 9000
ENTRYPOINT ["/usr/local/bin/webhook"]
CMD ["-verbose", "-hooks=/etc/webhook/hooks.json", "-template"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment