mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Add basic devcontainer
This commit is contained in:
parent
eb762c31c6
commit
5f50ea3f02
4 changed files with 81 additions and 0 deletions
19
.devcontainer/Dockerfile
Normal file
19
.devcontainer/Dockerfile
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
FROM ruby:3.3.0-slim-bullseye
|
||||||
|
|
||||||
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
&& apt-get -y install --no-install-recommends \
|
||||||
|
apt-utils \
|
||||||
|
build-essential \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
imagemagick \
|
||||||
|
iproute2 \
|
||||||
|
libpq-dev \
|
||||||
|
openssh-client \
|
||||||
|
postgresql-client \
|
||||||
|
vim
|
||||||
|
|
||||||
|
RUN gem install bundler
|
||||||
|
RUN gem install foreman
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
14
.devcontainer/devcontainer.json
Normal file
14
.devcontainer/devcontainer.json
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"name": "Maybe",
|
||||||
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
|
"service": "app",
|
||||||
|
"workspaceFolder": "/workspace",
|
||||||
|
"containerEnv": {
|
||||||
|
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",
|
||||||
|
"GITHUB_USER": "${localEnv:GITHUB_USER}"
|
||||||
|
},
|
||||||
|
"remoteEnv": {
|
||||||
|
"PATH": "/workspace/bin:${containerEnv:PATH}"
|
||||||
|
},
|
||||||
|
"postCreateCommand": "bundle install"
|
||||||
|
}
|
45
.devcontainer/docker-compose.yml
Normal file
45
.devcontainer/docker-compose.yml
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: .devcontainer/Dockerfile
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- ..:/workspace:cached
|
||||||
|
- bundle_cache:/bundle
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
|
||||||
|
command: sleep infinity
|
||||||
|
|
||||||
|
environment:
|
||||||
|
DB_HOST: db
|
||||||
|
HOST: "0.0.0.0"
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:latest
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- postgres-data:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres-data:
|
||||||
|
bundle_cache:
|
|
@ -18,6 +18,9 @@ default: &default
|
||||||
# For details on connection pooling, see Rails configuration guide
|
# For details on connection pooling, see Rails configuration guide
|
||||||
# https://guides.rubyonrails.org/configuring.html#database-pooling
|
# https://guides.rubyonrails.org/configuring.html#database-pooling
|
||||||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
||||||
|
host: <%= ENV.fetch("DB_HOST") { "127.0.0.1" } %>
|
||||||
|
password: postgres
|
||||||
|
user: postgres
|
||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *default
|
<<: *default
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue