Configure a new edge
profile with your addon AWS credentials:
$ heroku config --app edgeapp
EDGE_AWS_ACCESS_KEY_ID: AKIA...
EDGE_AWS_SECRET_ACCESS_KEY: JRHH...
First, check out Discourse and patch it for Heroku. To get the first push to build we need to run migrations before asset precompilation. To get the web dyno to start, we need to configure Puma to stay in the foreground.
## Check out Discourse
$ git clone https://github.com/discourse/discourse.git
$ cd discourse
## Patch Discourse for Heroku
#!/bin/bash | |
set -ex | |
export GIT_DIR=src/$PKG/.git | |
run -s "Cloning" git clone $URL --branch $REF --single-branch src/$PKG && git reset --hard $SHA | |
PKGS=$(go list $PKG/...) | |
run -s "Linting" golint -set_exit_status $PKGS | |
run -s "Vetting" go vet -x $PKGS | |
run -s "Building" go build -v $PKGS |
$ aws iam create-user --user-name convox-support | |
{ | |
"User": { | |
"UserName": "convox-support", | |
"Path": "/", | |
"CreateDate": "2015-08-09T15:16:09.027Z", | |
"UserId": "AIDAIEXRZQYWRHLT6NX6O", | |
"Arn": "arn:aws:iam::901416387788:user/convox-support" | |
} | |
} |
root@642dc10588ea:/var/www/html# find . -type f | wc -l | |
11035 | |
root@642dc10588ea:/var/www/html# tar cfv /tmp/oc.tar --one-file-system -C /usr/src/owncloud . | |
root@642dc10588ea:/var/www/html# du -h /tmp/oc.tar | |
98M /tmp/oc.tar | |
root@642dc10588ea:/var/www/html# time tar cfv - --one-file-system -C /usr/src/owncloud . | tar xf - -k | |
real 0m36.628s |
FROM ubuntu:16.04 | |
RUN apt-get update | |
RUN apt-get -yy install build-essential ruby-dev | |
RUN apt-get -yy install libmysqld-dev libpq-dev libsqlite3-dev | |
RUN apt-get -yy install nginx nodejs | |
WORKDIR /app | |
ENV PORT 5000 |
var http = require('http'); | |
exports.handler = function(event, context) { | |
// return success before 5m | |
console.log("setTimeout start"); | |
setTimeout(function(){ | |
console.log('setTimeout 290s finish'); | |
context.succeed('setTimeout 290s finish'); | |
}, 290000); |
# Save the AWS Convox API environment to .env | |
$ convox ps --app convox | |
ID NAME RELEASE SIZE STARTED COMMAND | |
7e41311911f7 registry 20160127162722 256 3 hours ago /docker-entrypoint.sh | |
7a3ef788202b web | |
$ convox exec --app convox 7a3ef788202b env > .env | |
# Start a Docker Machine environment |
ROOT ?= $(shell pwd) | |
all: vendor/nginx | |
clean: | |
rm -rf $(ROOT)/src | |
rm -rf $(ROOT)/vendor | |
vendor/luajit: src | |
cd src/LuaJIT-2.0.2 \ |