All code is available in example app - https://github.com/maxivak/webpacker-rails-example-app
You have to do 2 things in order to allow your container to access your host's postgresql database
- Make your postgresql listen to an external ip address
- Let this client ip (your docker container) access your postgresql database with a given user
Obs: By "Host" here I mean "the server where docker is running on".
Find your postgresql.conf (in case you don't know where it is)
$ sudo find / -type f -name postgresql.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.4-alpine3.7 | |
# Install dependencies: | |
# - build-base: To ensure certain gems can be compiled | |
# - nodejs: Compile assets | |
# - postgresql-dev postgresql-client: Communicate with postgres through the postgres gem | |
# - libxslt-dev libxml2-dev: Nokogiri native dependencies | |
# - imagemagick: for image processing | |
RUN apk --update add build-base nodejs tzdata postgresql-dev postgresql-client libxslt-dev libxml2-dev imagemagick |
Slides: https://speakerdeck.com/davydovanton/hanami-architecture
Telegram channel (russian): https://t.me/pepegramming
Ссылки на конкретные посты: http://telegra.ph/Pepegramming-Contents-07-16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Русский перевод для https://github.com/plataformatec/devise/tree/v4.3.0 | |
# Другие переводы на http://github.com/plataformatec/devise/wiki/I18n | |
ru: | |
devise: | |
confirmations: | |
confirmed: "Ваша учётная запись подтверждена." | |
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи." | |
send_paranoid_instructions: "Если ваш электронный адрес есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи." | |
failure: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: | |
build: . | |
volumes: | |
- .:/opt/myapp | |
ports: | |
- '3000:3000' | |
links: | |
- db | |
- redis | |
- selenium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# conf.d file for git-daemon | |
# | |
# Please check man 1 git-daemon for more information about the options | |
# git-daemon accepts. You MUST edit this to include your repositories you wish | |
# to serve. | |
# | |
# Some of the meaningful options are: | |
# --syslog --- Enables syslog logging | |
# --verbose --- Enables verbose logging | |
# --export-all --- Exports all repositories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyJob < ActiveJob::Base | |
queue_as :urgent | |
rescue_from(NoResultsError) do | |
retry_job wait: 5.minutes, queue: :default | |
end | |
def perform(*args) | |
MyService.call(*args) | |
end |
This post shows how to make sitemap.xml for your web site. The sitemap will be accessible by URL http://mysite.com/sitemap.xml
Myrails::Application.routes.draw do
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ru: | |
date: | |
formats: | |
# Форматы указываются в виде, поддерживаемом strftime. | |
# По умолчанию используется default. | |
# Можно добавлять собственные форматы | |
# | |
# | |
# Use the strftime parameters for formats. | |
# When no format has been given, it uses default. |
NewerOlder