rails-lambda / lamby

🐑🛤 Simple Rails & AWS Lambda Integration

Home Page:https://lamby.cloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Postgres ?

hopewise opened this issue · comments

Reading document here https://lamby.cloud/docs/database, seems there is no example about using Rails with Postgres

I tried to use Dockerfile as:

FROM ruby:3.2.0-buster

# Install dependencies needed for PostgreSQL
RUN apt-get update && \
    apt-get install -y postgresql-client libpq-dev

but when running the app in lambda, I got error:

could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Is there any example of Rails using Postgres with Lamby based project?

No, but technically this is not in the Lamby camp of responsibilities since this is "just Docker" which is a high level way of saying it is just Rails, Ubuntu, Docker, Docker Compose, & Devcontainers. Meaning all the info out there on running Postgress with these technologies is out there.

That said, you are on the right path, but you will need this in both the .devcontainer docker file and the root one shipped to prod. You will also need to update your database.yml and swap out the mysql service with a pg one in your devcontainer compose file.

Let track that discussion here. rails-lambda/lamby-cookiecutter#27