Skip to content
Snippets Groups Projects
Commit 56e1bb1b authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #521 from metabase/deployment_files

add basic scaffolding files for an Elastic Beanstalk deployment.
parents e493e509 058e8b20
No related branches found
No related tags found
No related merge requests found
option_settings:
- namespace: aws:elasticbeanstalk:command
option_name: Timeout
value: 600
commands:
test_command:
command: sed -i 's/location \/ {/location \/ {\nif ($http_x_forwarded_proto != "https") {\n set $var "redirect";\n}\n\nif ($request_uri = "\/api\/health") {\n set $var "${var}_health";\n}\n\nif ($var = 'redirect') {\n rewrite ^ https:\/\/$host$request_uri? permanent;\n}\n/' *-proxy.conf
cwd: /etc/nginx/sites-available
ignoreErrors: true
FROM ubuntu:trusty
ENV LC_ALL C
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
ENV MB_JETTY_PORT 3000
# basic update of our system + adding Java
RUN apt-get update && \
apt-get install -y openjdk-7-jre
# include our local build in the image
# TODO: eventually we could probably set this up to download the jar file dynamically
COPY ./metabase-standalone.jar /app/
COPY ./run_metabase.sh /app/
RUN chmod 755 /app/run_metabase.sh
# make our webserver port available
EXPOSE 3000
# run it
ENTRYPOINT ["/app/run_metabase.sh"]
{
"AWSEBDockerrunVersion": "1",
"Logging": "/var/log/metabase"
}
#!/bin/bash
# Metabase Web Container
export MB_JETTY_HOST=$HOSTNAME
# NOTE: we set MB_JETTY_PORT in our Dockerfile in order to ensure we bind to the port exposed by Docker
# Metabase Database Info
# TODO: we could make this generic by first checking if the $RDS_* env variables are available and if
# so then apply the code below and map them to our Metabase env variables
export MB_DB_DBNAME=$RDS_DB_NAME
export MB_DB_USER=$RDS_USERNAME
export MB_DB_PASS=$RDS_PASSWORD
export MB_DB_HOST=$RDS_HOSTNAME
export MB_DB_PORT=$RDS_PORT
# TODO: dynamically determine type, probably using the port number
export MB_DB_TYPE=postgres
java -Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -jar /app/metabase-standalone.jar
#!/bin/bash
BASEDIR=$(dirname $0)
PROJECT_ROOT=`cd ${BASEDIR}/..; pwd`
UBERJAR_DIR="${PROJECT_ROOT}/target/uberjar"
RELEASE_TYPE="aws-eb-docker"
if [ ! -z $2 ]; then
echo $2
fi
if [ -z $1 ]; then
echo "Oops! You need to specify a name for the release as an argument."
exit 1
fi
RELEASE_FILES="${PROJECT_ROOT}/deploy/${RELEASE_TYPE}"
RELEASE_FILE="${PROJECT_ROOT}/${1}.zip"
# package up the release files
(cd $RELEASE_FILES; zip -r $RELEASE_FILE * .ebextensions)
# add the built uberjar
(cd $UBERJAR_DIR; cp metabase-*-SNAPSHOT-*.jar metabase-standalone.jar; zip $RELEASE_FILE metabase-standalone.jar)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment