Eleman Docker Container Tutorial: How To Set Up & Configure - miratcan/Eleman GitHub Wiki
Glossary
To make this document understandable for a wide spectrum of users, I find it useful to go over some concepts:
Concept | Description |
---|---|
Airtable | Service that allows it's users to create and manage databases with the familiarity of spreadsheets. |
Airtable Base | Collection of tables in Airtable service. You can think that as a database. |
Eleman | Simple flask app to run job listing website. It converts the specific type of Airtable Bases to job listing web sites. |
Docker | A tool that allows users to develop and deploy applications inside virtual environments, called containers. With a single image, Docker can boot up an application with all its libraries and dependencies. |
In this tutorial, learn how to deploy an Eleman Docker container and start working with the containerized job listing website.
Prerequisites:
- Access to a command line/terminal window
- An existing Docker installation
- An Airtable account
- A text editor
Steps
1. Create a Settings File:
Eleman uses environment variables to build up it's configuration. Recommended way of passing these values is creating an environment file with a name something like mysitename.env and passing it to the Docker. There are 4 lines that file must exist.
Line | Description |
---|---|
SITE_TITLE=Water World | This is the title of the website. Which appears on the top of the website. |
SITE_DESC=Job Board for Divers | This is the description of the website. Which appears just below the title. |
AIRTABLE_API_KEY=abc | This is a string called API key, which allows external applications to interact with your databases. Obtaining it will be described at "Getting Airtable API Key" section. |
AIRTABLE_BASE_ID=abc | This is a unique string that works as an identity of Airtable Base. Obtaining it will be described at "Getting Airtable Base Key" section. |
2. Get your Airtable API Key
Step 1: Go to airtable.com and log in.
Step 2: Click your avatar on the top right of the screen and click "Account" in the dropdown menu.
Step 3: Scroll down the page a little bit, under API section you will find a box filled with dots. (If it is empty click Regenerate Button).
The API key is being hidden by default for some security reasons. Click inside the box to make it appear. Copy that key and paste it to your environment file as a value of AIRTABLE_API_KEY.
3. Duplicate Airtable Base to Your Workspace
Step 1: Log in to airtable.com
Step 2: Eleman works with Airtable Bases which is duplicated from our template. Click here to open that template.
Step 3: Click the title of the base and select a "Duplicate Base" option.
Step 4: Click "Duplicate base" button in the form.
Step 5: Check if "Eleman Template copy" base appeared on your workspace.
Step 5: Click the triangle on the top right of the "Eleman Template copy" base and rename it.
It's named "Water World" in our example.
4. Get your Airtable Base Id
Step 1: Go to airtable.com and log in.
Step 2: Go to airtable.com/api/ and click your base (Water World in our example).
Step 3: Scroll down a bit and find the line starting with "The ID of this base is".
Your base id is the string that is starting with "app". Copy and paste it to your settings file as a value of "AIRTABLE_BASE_ID".
5. Run Eleman via Docker
When your settings file is ready you're ready to run Eleman. Just type the command below:
docker run -p 80:80 --env-file waterworld.env eleman
6. Check it from your browser
Open your browser and go to localhost. You must see your job board there.