Change NGINX Binary in Heroku PHP Buildpack - heroku

I'd like to use nginx within a dokku/heroku setting with the ssl module enabled:
+ --with-http_ssl_module
What is the easiest way to achieve that? Cloning the php buildpack alone does not do the trick. How can I recompile the nginx binary? How can I rebuild a buildpack?

ok - i did it like this:
forked the buildpack
changed the nginx dependency to 1.10:
$require["heroku-sys/nginx"] = "~1.10.0";
in platform.php
then compiled and stored a new nginx package (based on the official heroku one)
stored the package somwhere public on amazon s3
added to the app environment the line export HEROKU_PHP_PLATFORM_REPOSITORIES='https://s3.region.amazonaws.com/your-bucket/packages.json'
If deploying an app, nginx will be loaded from your custom repository and installed within the docker image.

Related

Deploying Strapi to Heroku

I've been following the official Strapi tutorials on how to develop and deploy an application to Heroku and it seems you have to configure some files like ./config/environments/**/database.json.
The problem is that, installing the app without --quickstart (yarn create strapi-app my-project), my config folder just has a functions folder and database.js and server.js files.
Should I create manually this database.json or is this supposed to be created automatically when initializing the app without --quickstart?
I was also confused so I manually created the folders /environments/production and inside the file database.json and it worked for me.
Link to the docs: https://strapi.io/documentation/3.0.0-beta.x/deployment/heroku.html#_4-update-your-database-config-file

Problem with deploying Go app to Google App Engine

I developed my first Go app and decided to deploy it to Google Cloud (App Engine). It was running perfectly fine locally but I run into a few issues during the deployment (I'm using Cloud SDK).
I eventually got to the point where I was able to successfully deploy it to GCP but I keep getting
when trying to access the app.
I cannot do any local development either because every time I run go run main.go, go get -u, go build I'm getting:
go: finding module for package github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/mysql
go: found github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/mysql in github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20200513164142-a9864b03c326
go: github.com/GoogleCloudPlatform/cloudsql-proxy#v0.0.0-20200513164142-a9864b03c326 requires
cloud.google.com/go#v0.56.0 requires
cloud.google.com/go/bigquery#v1.4.0 requires
cloud.google.com/go#v0.52.0 requires
cloud.google.com/go/bigquery#v1.0.1/go.mod: verifying module: cloud.google.com/go/bigquery#v1.0.1/go.mod: cannot authenticate record data in server response
My go.mod file looks like this:
module swanson
go 1.14
require github.com/gorilla/mux v1.7.4
and this is the structure of my app (main.go, models, and router are 3 different packages):
I'm new to Go development and never deployed a Go app to GCP so feeling quite lost, any help would be much appreciated.
I have tried deploying a go application in app engine and also running it locally and both worked.
I used
this application
in github, which you can clone with the command:
git clone https://github.com/GoogleCloudPlatform/golang-samples
The command I have used for running the application locally is :
go run helloworld.go
And the command returned the following message:
2020/05/22 11:34:16 Defaulting to port 8080
2020/05/22 11:34:16 Listening on port 8080
Then in the Cloud Shell I have opened the web preview in the port 8080 and it was working as expected.
For more information about the deployment, you can check this documentation.

Using laradock docker configuration for developing

Hello there we am currently developing a Laravel application. I want all my team members to work locally so we decided to use Docker for our local development environment. I did a little research and there is a project called laradock. After installing it I am supposed to go to http://localhost and the project should run. But I get this:
I am using apache2 and mysql
tl;dr
Go to ./laradock/.env and search for APACHE_DOCUMENT_ROOT then edit that line to this:
APACHE_DOCUMENT_ROOT=/var/www/public
Things to do after the change
For this change to take effect, you have to:
Rebuild the container: docker-compose build apache2
Restart the containers: docker-compose up
Explanation
As mentioned by simonvomeyser on GitHub this is a recent addition which had the same effect as rodion.arr's solution but this way you can leave the original config files untouched and use the .env file to store all your project related configurations. Obviously, since this is a docker config change, you have to rebuild and restart your container, as rodion-arr and 9bits ponted it out in the same thread.
Check you apache configuration (in my case [laradock_folder]/apache2/sites/default.apache.conf file).
You should have DocumentRoot /var/www/public/.
I suppose you have /var/www/ instead

Deploying phoenix framework on heroku with webpack

I followed the docs in the official website. The problem is I use webpack as my bundler instead of brunch. The deployment is successful. I can even access the api routes. My only problem is the assets (js,css) in the homepage is not found. Locally, I can access the home page successfully when I run mix phoenix.server.
I tried peeking at the priv/static folder in heroku (using heroku run bash) where the files are moved after being compiled and saw the asset files there. Did I miss anything? or a configuration that I should put?
Here is the remote deploy output
http://pastebin.com/1mL1YWTS
Here is my custom compile file (to override phoenix-static buldpack)
http://pastebin.com/BGHf9xBK
Here is my webpack.config.js
http://pastebin.com/Xv2E1yCE
I have used webpack with the following compile:
./node_modules/.bin/webpack -p
mix phoenix.digest
You need to call mix phoenix.digest to generate a manifest that can be used in the static path helpers. http://hexdocs.pm/phoenix/Mix.Tasks.Phoenix.Digest.html#run/1

Deploying Django to Heroku using a Windows machine (Production server NOT development server)

I use a Windows machine and have a Django project that I have successfully deployed to Heroku, albeit using the development server. To use a production server Heroku seems to require 'Gunicorn' which does not run on Windows.
This is not good for testing locally before deploying. Does anyone know of any way to get around this? Perhaps some way to use a different server on Heroku?
I found a solution that may help when deploying to heroku using a Windows machine. Here is what I do:
Use the development server locally with:
python manage.py runserver
Install and add 'Gunicorn' to your installed apps in settings.py.
Add a process file in the root directory that tells heroku to use the Gunicorn server. This is a file called 'Procfile' with the following code:
web: python kalail/manage.py run_gunicorn --bind=0.0.0.0:$PORT
This way you test using the development server, while heroku uses the Gunicorn server. Make sure you set up serving static files(css/js/imgs) after this, because only the development server automatically serves static files, and the Gunicorn server will need to be configured to do so.
You can run the development server locally quite easily:
> python manage.py runserver
All you need to do is specify path to wsgi script from root directory:
$web: gunicorn hellodjango.wsgi

Resources