Comments (5)
FWIW, the approach I'm using is to have a separate postgres container for the database.
You can link the containers together, then expose the host and port environment variables to your app, and put these environment variables in your database.yml
file.
My basic configuration looks like:
# /etc/nginx/main.d/app_name.conf
env POSTGRES_PORT_5432_TCP_ADDR;
env POSTGRES_PORT_5432_TCP_PORT;
# /home/app/app_name/config/database.yml (for a rails app)
development:
adapter: postgresql
encoding: unicode
database: name_this_database
username: postgres
password:
host: <%= ENV['POSTGRES_PORT_5432_TCP_ADDR'] %>
port: <%= ENV['POSTGRES_PORT_5432_TCP_PORT'] %>
pool: 5
timeout: 5000
template: template0
# Start a database container
docker run --name $DATABASE_CONTAINER_NAME -d postgres
# Start the app container
docker run --name $APP_CONTAINER_NAME -v /local_src_directory:/home/app/app_name --link $DATABASE_CONTAINER_NAME:postgres -d $APP_IMAGE_NAME
This gives you a database connection, but you'll still need to run rake db:setup
or similar during startup to create and seed your DB.
from passenger-docker.
Thanks for your answer, I'm also using a separate container for the Postgres Database.
Your answer contains several useful hints to get me further.
But i was able to find the root of the problem by now.
The following should find its way into the Readme:
You have to do an apt-get update when using the images; e.g:
FROM phusion/passenger-full:0.9.11
ENV HOME /root
CMD ["/sbin/my_init"]
RUN apt-get update
...continue here
from passenger-docker.
@danielkummer I don't believe the full image includes dev headers, and yeah, you're right, you need to run apt-get update first or you'll try to pull old packages that don't exist anymore.
RUN apt-get update -qq
RUN /build/devheaders.sh
from passenger-docker.
@skord it works with the passenger-full image (even the devheaders) but it doesn't seem to work with passenger-customizable (which it should in my opinion)
from passenger-docker.
Probably a bug in passenger-customizable. I'll have a look once I have time.
from passenger-docker.
Related Issues (20)
- Ruby 3.2 image release HOT 5
- error while trying to write to `/bundle/ruby/2.7.0`. HOT 1
- Ruby 3.2 is not built with YJIT HOT 2
- Node 18 HOT 1
- Switch base to Debian 11 from Ubuntu
- Passenger Ruby 3.x several vulnerabilities ? HOT 3
- Baseimage tag MASTER is GONE HOT 1
- I need to have --with-http_mp4_module in nginx in Passenger-ruby32 docker image HOT 2
- Changes to nodesource distributions / discontinuation of setup scripts HOT 1
- New Release? HOT 3
- Failed to fetch Node 18 issue with passenger-ruby30:2.5.1-arm64 HOT 4
- Error while trying to use Ruby 3.3 HOT 4
- Update Node to LTS 20 HOT 1
- how to set license_proxy_url HOT 1
- irb/rails console RC file error HOT 9
- Segmentation fault HOT 3
- neither passenger_max_instances or passenger_max_pool_size seem to work (RoR) HOT 1
- Images update for dockerhub images
- Plain bash shell execution doesn't load rvm
- phusion/passenger-ruby30:3.0.5 missing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passenger-docker.