Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres ? #161

Closed
hopewise opened this issue May 5, 2023 · 2 comments
Closed

Postgres ? #161

hopewise opened this issue May 5, 2023 · 2 comments

Comments

@hopewise
Copy link

hopewise commented May 5, 2023

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?

@metaskills
Copy link
Member

metaskills commented May 5, 2023

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.

@metaskills
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants