based on DigitalOcean guide
Create local project
local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
app = "app-name" | |
kill_signal = "SIGINT" | |
kill_timeout = 5 | |
[deploy] | |
release_command = "bin/hanami db migrate" | |
[env] | |
HANAMI_ENV="production" |
FROM ruby:2.3.1 | |
# Install dependencies | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs | |
# Set an environment variable where the Rails app is installed to inside of Docker image: | |
ENV RAILS_ROOT /var/www/app_name | |
RUN mkdir -p $RAILS_ROOT | |
# Set working directory, where the commands will be ran: |
based on DigitalOcean guide
Create local project
local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.
autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master
and add the last line:
#
# Automounter master map
#
+auto_master # Use directory service
Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true
and false
. In Python, for example, they're written as True
and False
. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).
This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.
If you want to use or share this material, please see the license file, below.
$ uname -r
FROM crystallang/crystal:0.27.2 as builder | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends build-essential \ | |
apt-transport-https curl ca-certificates gnupg2 apt-utils | |
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \ | |
&& apt-get install -y nodejs | |
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ |
AllCops: | |
RunRailsCops: true | |
# Commonly used screens these days easily fit more than 80 characters. | |
Metrics/LineLength: | |
Max: 120 | |
# Too short methods lead to extraction of single-use methods, which can make | |
# the code easier to read (by naming things), but can also clutter the class | |
Metrics/MethodLength: |
FROM crystallang/crystal:0.27.2 | |
WORKDIR /opt/src | |
# Install nodejs | |
COPY bin ./bin | |
RUN bin/nodesource_11.x | |
RUN apt-get update && apt-get install -y nodejs | |
# npm install |
We develop locally on MacOS. Due to some issues with cross compilation, we build the crystal binary on docker locally, | |
then zip that up and ship that along with the docker stuff to elasticbeanstalk. |