Skip to content

Commit

Permalink
Added local silverbox instance
Browse files Browse the repository at this point in the history
  • Loading branch information
bjuraszewski committed Mar 1, 2022
1 parent fc460a4 commit 6ea0ba0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ EMAIL_PASSWORD=secret
EMAIL_ADDRESS=example@example.com
EMAIL_NAME=Store

SILVERBOX_HOST=https://cdn.example.com
SILVERBOX_HOST=silverbox.localhost
SILVERBOX_CLIENT=heseya
SILVERBOX_KEY=secret

Expand Down Expand Up @@ -68,6 +68,7 @@ PAYU_URL=https://secure.payu.com

DOCKER_PORT=80
DOCKER_ADMINER_PREFIX=adminer
DOCKER_SILVERBOX_PREFIX=silverbox

PAYPAL_SANDBOX=true
PAYPAL_CLIENT_ID=
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,21 @@ services:
- ${DOCKER_PORT}:80
environment:
- ADMINER_PREFIX=${DOCKER_ADMINER_PREFIX}
- SILVERBOX_PREFIX=${DOCKER_SILVERBOX_PREFIX}
silverbox:
image: heseya/silverbox:1.2.0
restart: unless-stopped
command:
- bash
- -c
- |
if [ ! -f "/usr/src/init" ]; then
php silverbox client:add ${SILVERBOX_CLIENT} ${SILVERBOX_KEY}
chown -R www-data:www-data storage
touch /usr/src/init
fi
exec apache2-foreground
networks:
default:
aliases:
- ${SILVERBOX_HOST}
14 changes: 13 additions & 1 deletion docker/nginx/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}

server {
listen 80;
server_name ${SILVERBOX_PREFIX}.*;

location / {
proxy_pass http://silverbox:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

0 comments on commit 6ea0ba0

Please sign in to comment.