Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker demo #326

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine:3.13.3

RUN apk add curl openssl php7 php7-curl php7-openssl php7-gmp php7-mbstring php7-json php7-phar

RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer

RUN mkdir /app; cd /app; composer create-project minishlink/web-push-php-example

RUN cd /app/web-push-php-example; openssl ecparam -genkey -name prime256v1 -out keys/private_key.pem && \
openssl ec -in private_key.pem -pubout -outform DER|tail -c 65|base64|tr -d '=' |tr '/+' '_-' >> keys/public_key.txt && \
openssl ec -in private_key.pem -outform DER|tail -c +8|head -c 32|base64|tr -d '=' |tr '/+' '_-' >> keys/private_key.txt

EXPOSE 8000

CMD [ "php", "-S", "0.0.0.0:8000", "/app/web-push-php-example/router.php" ]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.7'
# https://github.com/c4tom/web-push-php

services:
web_push_php:
image: cahato/web-push-php:latest
build:
context: ./
dockerfile: Dockerfile
container_name: alpine_php_webpush_php
hostname: web_push_php
ports:
- "8000:8000"