Skip to content

Commit dc14a12

Browse files
authored
Merge pull request #89 from PhlexUI/cirdes/move-to-sqlite-and-fly
Switch to SQLite3, Upgrade Ruby and Rails, Remove Unused Gems, and Add Fly.io Deployment Configuration
2 parents 665f879 + 30e4644 commit dc14a12

40 files changed

+665
-930
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
2-
ARG RUBY_VERSION=3.3.0
2+
ARG RUBY_VERSION=3.3.4
33
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION

.devcontainer/compose.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,9 @@ services:
2424
- 45678:45678
2525
depends_on:
2626
- selenium
27-
- redis
28-
- postgres
2927

3028
selenium:
3129
image: seleniarm/standalone-chromium
3230
restart: unless-stopped
3331
networks:
3432
- default
35-
36-
redis:
37-
image: redis:7.2
38-
restart: unless-stopped
39-
networks:
40-
- default
41-
volumes:
42-
- redis-data:/data
43-
44-
postgres:
45-
image: postgres:16.1
46-
restart: unless-stopped
47-
networks:
48-
- default
49-
volumes:
50-
- postgres-data:/var/lib/postgresql/data
51-
environment:
52-
POSTGRES_USER: postgres
53-
POSTGRES_PASSWORD: postgres
54-
55-
volumes:
56-
redis-data:
57-
postgres-data:

.devcontainer/devcontainer.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@
1010
"features": {
1111
"ghcr.io/devcontainers/features/github-cli:1": {},
1212
"ghcr.io/rails/devcontainer/features/activestorage": {},
13-
"ghcr.io/rails/devcontainer/features/postgres-client": {},
14-
"ghcr.io/devcontainers/features/node:1": { "version": 20 }
13+
"ghcr.io/devcontainers/features/node:1": { "version": 20 },
14+
"ghcr.io/rails/devcontainer/features/sqlite3": {}
1515
},
1616

1717
"containerEnv": {
1818
"CAPYBARA_SERVER_PORT": "45678",
19-
"SELENIUM_HOST": "selenium",
20-
"REDIS_URL": "redis://redis:6379/1",
21-
"DB_HOST": "postgres"
19+
"SELENIUM_HOST": "selenium"
2220
},
2321

2422
// Use 'forwardPorts' to make a list of ports inside the container available locally.
25-
"forwardPorts": [3000, 5432, 6379],
23+
"forwardPorts": [3000, 6379],
2624

2725
// Configure tool-specific properties.
2826
// "customizations": {},

.dockerignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2+
3+
# Ignore git directory.
4+
/.git/
5+
6+
# Ignore bundler config.
7+
/.bundle
8+
9+
# Ignore all environment files (except templates).
10+
/.env*
11+
!/.env*.erb
12+
13+
# Ignore all default key files.
14+
/config/master.key
15+
/config/credentials/*.key
16+
17+
# Ignore all logfiles and tempfiles.
18+
/log/*
19+
/tmp/*
20+
!/log/.keep
21+
!/tmp/.keep
22+
23+
# Ignore pidfiles, but keep the directory.
24+
/tmp/pids/*
25+
!/tmp/pids/.keep
26+
27+
# Ignore storage (uploaded files in development and any SQLite databases).
28+
/storage/*
29+
!/storage/.keep
30+
/tmp/storage/*
31+
!/tmp/storage/.keep
32+
33+
# Ignore assets.
34+
/node_modules/
35+
/app/assets/builds/*
36+
!/app/assets/builds/.keep
37+
/public/assets

.github/workflows/fly-deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Fly Deploy
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: superfly/flyctl-actions/setup-flyctl@master
16+
- run: flyctl deploy --remote-only
17+
env:
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

.github/workflows/main.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,6 @@ jobs:
4040
test:
4141
timeout-minutes: 10
4242
runs-on: ubuntu-latest
43-
services:
44-
postgres:
45-
image: postgres:latest
46-
env:
47-
POSTGRES_USER: postgres
48-
POSTGRES_PASSWORD: password
49-
POSTGRES_DB: test
50-
ports: ["5432:5432"]
51-
options: >-
52-
--health-cmd pg_isready
53-
--health-interval 10s
54-
--health-timeout 5s
55-
--health-retries 5
56-
redis:
57-
image: redis
58-
ports: ["6379:6379"]
59-
options: >-
60-
--health-cmd "redis-cli ping"
61-
--health-interval 10s
62-
--health-timeout 5s
63-
--health-retries 5
64-
6543
steps:
6644
- uses: actions/checkout@v4
6745

@@ -73,7 +51,7 @@ jobs:
7351
- name: Setup Node
7452
uses: actions/setup-node@v4
7553
with:
76-
node-version-file: ".tool-versions"
54+
node-version-file: ".node-version"
7755
cache: yarn
7856

7957
- name: Install dependencies
@@ -84,8 +62,6 @@ jobs:
8462
8563
- name: Run tests
8664
env:
87-
DATABASE_URL: postgres://postgres:password@localhost:5432/test
88-
REDIS_URL: redis://localhost:6379/0
8965
RAILS_ENV: test
9066
# RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
9167
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@
3636
/node_modules
3737

3838
.env*
39+
40+
/.yarn/*
41+
.yarnrc

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.10.0

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.0
1+
3.3.4

.tool-versions

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)