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

Heroku compatible deploy #344

Open
wants to merge 2 commits into
base: main
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ RUN wget ${archive_url} && \
COPY conf/php-fpm-pool.conf /etc/php7/php-fpm.d/www.conf
COPY conf/supervisord.conf /etc/supervisor/supervisord.conf
COPY conf/nginx.conf /etc/nginx/nginx.conf
COPY conf/nginx-site.conf /etc/nginx/conf.d/default.conf
COPY conf/nginx-site.conf.template /etc/nginx/conf.d/default.conf.template
COPY conf/.env.docker /var/www/html/.env
COPY entrypoint.sh /sbin/entrypoint.sh

Expand Down
2 changes: 2 additions & 0 deletions conf/.env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ DB_PASSWORD="{{DB_PASSWORD}}"
DB_PORT="{{DB_PORT}}"
DB_PREFIX="{{DB_PREFIX}}"

PORT="{{PORT}}"

DOCKER=true

CACHE_DRIVER="{{CACHE_DRIVER}}"
Expand Down
4 changes: 2 additions & 2 deletions conf/nginx-site.conf → conf/nginx-site.conf.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
listen 8000 default; ## Listen for ipv4; this line is default and implied
listen [::]:8000 default; ## Listen for ipv6
listen $PORT default; ## Listen for ipv4; this line is default and implied
listen [::]:$PORT default; ## Listen for ipv6

# Make site accessible from http://localhost/
server_name localhost;
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ services:
- APP_ENV=${APP_ENV:-production}
- APP_DEBUG=false
- DEBUG=false
- PORT=8000
depends_on:
- postgres
restart: on-failure
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ initialize_system() {
APP_DEBUG=${APP_DEBUG:-true}
APP_URL=${APP_URL:-http://localhost}
APP_LOG=${APP_LOG:-errorlog}
PORT=${PORT:-8000}

DB_DRIVER=${DB_DRIVER:-pgsql}
DB_HOST=${DB_HOST:-postgres}
Expand Down Expand Up @@ -228,6 +229,7 @@ start_system() {
seed_db
echo "Starting Cachet! ..."
php artisan config:cache
envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may need to actually happen along with all of the sed replacement such as https://github.com/CachetHQ/Docker/blob/master/entrypoint.sh#L186 -- the CI failures seem to be related to a permissions error when trying to write to /etc/nginx/conf.d/default.conf as the non-root user.

/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
}

Expand Down