Skip to content

Instantly share code, notes, and snippets.

@sabman
Last active March 17, 2022 17:29
Show Gist options
  • Save sabman/e4b1a8b03f5249d07d8c26f76da8a6d4 to your computer and use it in GitHub Desktop.
Save sabman/e4b1a8b03f5249d07d8c26f76da8a6d4 to your computer and use it in GitHub Desktop.

Requirements

A publicly accessible domain name is required. One way to do this is to point your DNS record to an elastic IP attached to the new instance. To do this after launching your instance do the following

    1. Attach Elastic IP to the instance
    1. Set up DNS record to point to Elastic IP. Make sure the DNS is resolving
    1. SSH into your instance ssh ec2-user@ur-domain.com
    1. Use the following init script replacing environment variables
# === INIT SCRIPT ===
# ==== REPLACE THESE with your own ====
export PUBLIC_HOST=cartodb.host
export EMAIL=adm@acme.com
export ORG=acme
# UNAME (username) must be different from ORG (organisation name)
export UNAME=admin
# NOTE: don't have any white space in the password. have at least 6 characters and a mix of letters, number and optionally special non-alpha-numeric charecters.
export PASS=pass123

echo "
ENVIRONMENT=production
PUBLIC_HOST=${PUBLIC_HOST}
PUBLIC_PROTOCOL=https
PUBLIC_PORT=443
CARTO_ORG_NAME=$ORG
CARTO_ORG_USERNAME=$UNAME
CARTO_ORG_EMAIL=${EMAIL}
CARTO_ORG_PASSWORD=${PASS}
" > production.env

IMAGE_TAG=postgresql-13-postgis-3-stable
docker volume create carto-db-${IMAGE_TAG}
docker volume create carto-redis-${IMAGE_TAG}
docker volume create carto-data-${IMAGE_TAG}
docker volume create carto-jupyter-home-${IMAGE_TAG}
docker volume create carto-certs-${IMAGE_TAG}

# start the service
docker run --env-file production.env --name cartodb-rasul -v carto-data-${IMAGE_TAG}:/data -v carto-db-${IMAGE_TAG}:/var/lib/postgresql -v carto-redis-${IMAGE_TAG}:/var/lib/redis -v carto-jupyter-home-${IMAGE_TAG}:/home/sammy -v carto-certs-${IMAGE_TAG}:/etc/letsencrypt/live -p 80:80 -p 443:443 -d sabman/geodb:${IMAGE_TAG} >> userdata.log 2>&1

If you run into problems please contact us at support@getgeodb.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment