Initial commit - Fase 1: Setup Rails + Docker
This commit is contained in:
49
docker-compose.yml
Normal file
49
docker-compose.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
env_file: .env
|
||||
environment:
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_PORT: ${DB_PORT}
|
||||
DB_NAME: ${DB_NAME}
|
||||
DB_USER: ${DB_USER}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
|
||||
RAILS_ENV: ${RAILS_ENV:-development}
|
||||
volumes:
|
||||
- ".:/app"
|
||||
- "bundle_cache:/usr/local/bundle"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -b 0.0.0.0"
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${DB_NAME}
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
volumes:
|
||||
- "pg_data:/var/lib/postgresql/data"
|
||||
ports:
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
# NOTA: Se o banco existente (db_reem_simplerout_2026) estiver em servidor
|
||||
# separado, remova este serviço e configure DB_HOST no .env apontando para
|
||||
# o IP/hostname correto do servidor PostgreSQL existente.
|
||||
|
||||
volumes:
|
||||
pg_data:
|
||||
bundle_cache:
|
||||
Reference in New Issue
Block a user