ruby-ship 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +225 -140
- data/docs/build-environment.md +62 -0
- data/docs/configuration.md +90 -0
- data/docs/deployment.md +84 -0
- data/docs/releasing.md +33 -0
- data/docs/services.md +98 -0
- data/docs/standalone-runtimes.md +54 -0
- data/lib/ship/version.rb +1 -1
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 26ec347d5509404913573b1c0e514699c13d8a5d6fae753fd8e7382776286b9c
|
|
4
|
+
data.tar.gz: bb217dafa93730de72c05131be47155b80b44d09c82d294c17f81c1dde7b7cfc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4da26b24cc7345a95af211f5a78ac2033bbac3ae0ea74e075ff3784c4c8ae7663761c18cd785f64cb4568321885e1175711c8b6121769a77b96718b448af09dc
|
|
7
|
+
data.tar.gz: a42042b9308888dd9f41369a81aa10c8fecd13bbf474ba7ce18a3eb4b183913c9e076da94ece7cd193578db438c8c58215d139cbfca5c3ea3e72ed79aab1ea53
|
data/README.md
CHANGED
|
@@ -1,175 +1,260 @@
|
|
|
1
1
|
# Ruby Ship
|
|
2
2
|
|
|
3
3
|
[](https://github.com/ship-ecosystem/ruby-ship/actions/workflows/ci.yml)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
[](https://rubygems.org/gems/ruby-ship)
|
|
5
|
+
[](LICENSE.md)
|
|
6
|
+
|
|
7
|
+
Docker development environments and portable production releases for Rails,
|
|
8
|
+
Hanami, Sinatra, Roda, and Rack applications. Ruby Ship supplies the Ruby
|
|
9
|
+
runtimes and tooling for the shared `ship.json` configuration, CLI workflow, and
|
|
10
|
+
`ship-release` format. [Ship specification](https://github.com/ship-ecosystem/spec)
|
|
11
|
+
|
|
12
|
+
## Contents
|
|
13
|
+
|
|
14
|
+
- [Requirements](#requirements)
|
|
15
|
+
- [Quick start](#quick-start)
|
|
16
|
+
- [Commands](#commands)
|
|
17
|
+
- [Frameworks and runtimes](#frameworks-and-runtimes)
|
|
18
|
+
- [Services](#services)
|
|
19
|
+
- [Configuration](#configuration-shipjson)
|
|
20
|
+
- [Production releases](#production-releases)
|
|
21
|
+
- [HTTPS and reverse proxies](#https-and-reverse-proxies)
|
|
22
|
+
- [Development files and volumes](#development-files-and-volumes)
|
|
23
|
+
- [Extending Ship](#extending-ship)
|
|
24
|
+
- [Architecture](#architecture)
|
|
25
|
+
- [Contributing](#contributing)
|
|
26
|
+
- [License](#license)
|
|
27
|
+
|
|
28
|
+
## Requirements
|
|
29
|
+
|
|
30
|
+
- Ruby 3.3 or later and Bundler on the host.
|
|
31
|
+
- Docker Engine or Docker Desktop with Linux containers and Docker Compose.
|
|
32
|
+
- An app with a `Gemfile`, a `Gemfile.lock` with an exact `BUNDLED WITH` version,
|
|
33
|
+
and a `config.ru`. Include the Linux platforms you build and deploy on in the
|
|
34
|
+
lockfile.
|
|
35
|
+
- Puma in the app bundle for the default server. Falcon and Thruster have their
|
|
36
|
+
own gem requirements. [Framework and server setup](docs/standalone-runtimes.md)
|
|
7
37
|
|
|
8
38
|
## Quick start
|
|
9
39
|
|
|
10
|
-
Ruby Ship
|
|
11
|
-
|
|
40
|
+
Add Ruby Ship to your app's `Gemfile` as a development dependency.
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
gem "ruby-ship", "~> 0.1.0", group: :development, require: false
|
|
44
|
+
```
|
|
12
45
|
|
|
13
|
-
|
|
46
|
+
Install the bundle from the app directory and start the development stack.
|
|
14
47
|
|
|
15
48
|
```sh
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
49
|
+
bundle config set --local path vendor/bundle
|
|
50
|
+
bundle install
|
|
51
|
+
bundle exec ship init
|
|
52
|
+
bundle exec ship up
|
|
53
|
+
bundle exec ship logs --follow
|
|
21
54
|
```
|
|
22
55
|
|
|
23
|
-
|
|
56
|
+
Commit `Gemfile` and `Gemfile.lock` so collaborators can use `bundle install`.
|
|
57
|
+
Keep `.bundle/` and `vendor/bundle/` local. The rest of this guide uses `ship`
|
|
58
|
+
as shorthand for `bundle exec ship`. To try an unpublished checkout from the
|
|
59
|
+
app directory, run `ruby /path/to/ruby-ship/exe/ship init`.
|
|
60
|
+
|
|
61
|
+
`ship init` detects the framework and walks through the runtime, service
|
|
62
|
+
categories, providers, named instances, frontend tooling, processes, deploy
|
|
63
|
+
commands, Compose service names, external networks, and port publishing. Move
|
|
64
|
+
with the arrow keys and Enter, use Space to toggle multiple selections, press
|
|
65
|
+
Ctrl+U to go back, or Ctrl+C to cancel. Leave optional text fields blank to clear
|
|
66
|
+
those values. Select **None** to disable an optional provider.
|
|
67
|
+
|
|
68
|
+
`ship up` shows published HTTP endpoints once containers are ready. Use the
|
|
69
|
+
reported address to open the app. For automation, supply choices explicitly.
|
|
24
70
|
|
|
25
71
|
```sh
|
|
26
|
-
ship init
|
|
72
|
+
ship init --no-interaction --name warehouse-app --database postgres --cache redis
|
|
73
|
+
ship check
|
|
27
74
|
ship up
|
|
28
|
-
ship logs --follow
|
|
29
75
|
```
|
|
30
76
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Use the arrow keys and Enter in the setup dialog. Press Space to toggle service
|
|
36
|
-
categories and published ports, Ctrl+U to go back, or Ctrl+C to cancel.
|
|
37
|
-
Optional text fields can be left blank. `ship init --defaults` uses the app's
|
|
38
|
-
detected settings and any flags you provide.
|
|
39
|
-
|
|
40
|
-
Use **Processes to run** to enable a suggested worker or add a custom worker,
|
|
41
|
-
scheduler, or HTTP service. An HTTP process can declare a container port,
|
|
42
|
-
health check, and public URL setting. Use **Deploy commands** for jobs that
|
|
43
|
-
run once per release, such as database migrations.
|
|
77
|
+
For Rails, install the matching adapter first and prepare the database with
|
|
78
|
+
`ship rails db:prepare`. You can register the same operation as a one-off deploy
|
|
79
|
+
command. [Rails database setup](docs/services.md#rails-database-setup) · [Deploy commands](docs/deployment.md#deploy-commands)
|
|
44
80
|
|
|
45
|
-
|
|
46
|
-
binds to localhost. Production ports may be public, so leave them clear
|
|
47
|
-
when a reverse proxy reaches the app over the Docker network. Enter `0` for
|
|
48
|
-
an automatically assigned host port. Ship saves the selections in
|
|
49
|
-
`ship.json` and the chosen host port numbers in the matching environment file.
|
|
81
|
+
### Updating an existing project
|
|
50
82
|
|
|
51
|
-
|
|
52
|
-
|
|
83
|
+
Run `bundle update ruby-ship` and then `ship init` in the app directory. The
|
|
84
|
+
wizard starts from saved choices, regenerates the managed Docker files, and
|
|
85
|
+
lists additions, updates, and removals across all four environment files.
|
|
86
|
+
Commit `ship.json`, the generated Compose and `docker/ship/` files, and the two
|
|
87
|
+
`.env` examples. Put local changes in Compose override files and keep your
|
|
88
|
+
private environment files out of Git. [Generated files and environment updates](docs/configuration.md)
|
|
53
89
|
|
|
54
|
-
##
|
|
90
|
+
## Commands
|
|
55
91
|
|
|
56
|
-
|
|
|
92
|
+
| Command | What it does |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `ship init [--defaults]` | Configure the app and generate development and production files |
|
|
95
|
+
| `ship up [--no-build] [--wait-timeout SECONDS]` | Build and start development services, then wait for health checks |
|
|
96
|
+
| `ship down [--volumes]` | Stop development services. `--volumes` also removes named volumes such as database storage |
|
|
97
|
+
| `ship ps [OPTIONS]` | List development containers and published ports |
|
|
98
|
+
| `ship run [-e KEY=VALUE] [--] COMMAND [ARGS…]` | Run a command in a disposable app container, including before startup |
|
|
99
|
+
| `ship exec SERVICE COMMAND [ARGS…]` | Run a command in a running service |
|
|
100
|
+
| `ship shell [SERVICE]` | Open a shell, defaulting to the app service |
|
|
101
|
+
| `ship logs [-f] [--tail N] [SERVICE…]` | Read or follow service logs |
|
|
102
|
+
| `ship db [INSTANCE]` | Open a database client for the primary or named database |
|
|
103
|
+
| `ship bundle [ARGS…]` | Run Bundler inside the app container |
|
|
104
|
+
| `ship ruby [ARGS…]`, `ship rake [ARGS…]` | Run Ruby or Rake under the app bundle |
|
|
105
|
+
| `ship rails [ARGS…]`, `ship hanami [ARGS…]` | Run the selected framework's CLI |
|
|
106
|
+
| `ship npm`, `ship pnpm`, `ship yarn`, `ship bun` | Run frontend package commands in the container |
|
|
107
|
+
| `ship package-manager TOOL [VERSION]` | Set the frontend tool and optional exact version, then regenerate templates |
|
|
108
|
+
| `ship test [ARGS…]` | Run Cypress when selected, Rails tests for Rails, or `rake test` for other apps |
|
|
109
|
+
| `ship check [--compose] [--json]` | Validate project settings offline or also check the generated development Compose model |
|
|
110
|
+
| `ship doctor [--json]` | Check Docker, Compose configuration, and service state |
|
|
111
|
+
| `ship build [--tag TAG] [--platform OS/ARCH] [--no-cache]` | Build the production images |
|
|
112
|
+
| `ship release --tag TAG [--no-env] [--force]` | Build and export a portable release |
|
|
113
|
+
| `ship help [COMMAND]`, `ship --version` | Show usage or the installed version |
|
|
114
|
+
|
|
115
|
+
Pass `-C DIRECTORY` before the command to target another project. For a running
|
|
116
|
+
app, framework and Ruby commands use the existing app container. They can also
|
|
117
|
+
run in a disposable container while the stack is stopped.
|
|
118
|
+
|
|
119
|
+
### Image build output
|
|
120
|
+
|
|
121
|
+
Ship shows a progress indicator while Docker builds, hides successful build
|
|
122
|
+
logs, and prints diagnostics on failure. Use `ship --verbose up`,
|
|
123
|
+
`ship --verbose run -- bundle check`, or `ship --verbose build` to stream the
|
|
124
|
+
full build output. Container startup and service logs have their own output.
|
|
125
|
+
|
|
126
|
+
## Frameworks and runtimes
|
|
127
|
+
|
|
128
|
+
| Framework | Default development entry point | Production |
|
|
57
129
|
| --- | --- | --- |
|
|
58
|
-
|
|
|
59
|
-
| Hanami | `hanami server` | Puma with `config.ru` |
|
|
60
|
-
| Sinatra, Roda, Generic Rack | Puma with `config.ru` | Puma with `config.ru` |
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
installs the Bundler version recorded in `Gemfile.lock`. Include the deployment
|
|
66
|
-
platform in the lockfile if it's absent, for example
|
|
67
|
-
`bundle lock --add-platform x86_64-linux aarch64-linux`.
|
|
68
|
-
|
|
69
|
-
`ship bundle`, `ship ruby`, `ship rake`, `ship rails`, and `ship hanami` run
|
|
70
|
-
commands under the app's bundle. Run `ship rails db:prepare` to initialize a Rails
|
|
71
|
-
database in development. For production, use
|
|
72
|
-
`ship init --deploy-command 'bundle exec rails db:prepare'` to attach the
|
|
73
|
-
database preparation to each deploy.
|
|
130
|
+
| Rails (`rails`) | `bin/rails server` with Puma | Puma or Puma with Thruster |
|
|
131
|
+
| Hanami (`hanami`) | `hanami server` | Puma with `config.ru` |
|
|
132
|
+
| Sinatra (`sinatra`), Roda (`roda`), Generic Rack (`rack`) | Puma with `config.ru` | Puma with `config.ru` |
|
|
133
|
+
|
|
134
|
+
Use `ship init --server falcon` for a Rack application with Falcon in its
|
|
135
|
+
bundle. Ship uses the app's Ruby and Bundler declarations to build its image.
|
|
136
|
+
[Runtime selection, version pinning, and health checks](docs/standalone-runtimes.md)
|
|
74
137
|
|
|
75
138
|
## Services
|
|
76
139
|
|
|
77
|
-
| Group |
|
|
140
|
+
| Group | Built-in providers |
|
|
78
141
|
| --- | --- |
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
`
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
142
|
+
| `database` | PostgreSQL, MySQL, MariaDB, MongoDB, SQL Server, SQLite, ClickHouse |
|
|
143
|
+
| `cache` | Redis, Valkey, Memcached |
|
|
144
|
+
| `broker` | RabbitMQ |
|
|
145
|
+
| `mail` | Mailpit |
|
|
146
|
+
| `search` | Meilisearch, Elasticsearch, Typesense |
|
|
147
|
+
| `storage` | Garage, SeaweedFS, RustFS, Silo |
|
|
148
|
+
| `broadcasting` | Centrifugo, Mercure, AnyCable for Rails |
|
|
149
|
+
| `testing` | Selenium, Playwright, Cypress |
|
|
150
|
+
| `frontend` | Node.js with npm, pnpm, Yarn, or Bun |
|
|
151
|
+
|
|
152
|
+
Choose one primary provider per group. Use **Other named services** to add
|
|
153
|
+
another provider or instance with its own connection settings and data volume.
|
|
154
|
+
For example, to keep PostgreSQL as the primary database and add ClickHouse,
|
|
155
|
+
run `ship init --defaults --database postgres --add database:clickhouse:warehouse`.
|
|
156
|
+
Once the stack is up, `ship db warehouse` opens its client.
|
|
157
|
+
|
|
158
|
+
Enable Solid Queue, Sidekiq, and GoodJob from **Processes to run** when the app
|
|
159
|
+
bundle contains the matching dependencies. Custom workers, schedulers, and
|
|
160
|
+
HTTP services share the app image. [Service setup and connection settings](docs/services.md)
|
|
161
|
+
|
|
162
|
+
## Configuration (`ship.json`)
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"$schema": "https://raw.githubusercontent.com/ship-ecosystem/spec/main/schemas/ship.schema.json",
|
|
167
|
+
"name": "warehouse-app",
|
|
168
|
+
"framework": "rack",
|
|
169
|
+
"server": "puma",
|
|
170
|
+
"port": 3000,
|
|
171
|
+
"services": { "database": "postgres", "cache": "redis" },
|
|
172
|
+
"additionalServices": [
|
|
173
|
+
{ "group": "database", "service": "clickhouse", "name": "warehouse" }
|
|
174
|
+
],
|
|
175
|
+
"portPublishing": {
|
|
176
|
+
"development": ["app:3000"],
|
|
177
|
+
"production": []
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Use **Publish development ports** and **Publish production ports** in the
|
|
183
|
+
wizard to choose which endpoints are reachable from the host. Development
|
|
184
|
+
bindings use localhost. A production reverse proxy on Docker can reach HTTP
|
|
185
|
+
services through `externalNetwork`. [Configuration, processes, and environment files](docs/configuration.md)
|
|
186
|
+
|
|
187
|
+
Use `build.publicEnv` for public asset configuration, `build.secrets` for
|
|
188
|
+
BuildKit credentials, and `build.npmrc` for private npm registry configuration.
|
|
189
|
+
[Build and frontend settings](docs/build-environment.md)
|
|
190
|
+
|
|
191
|
+
## Production releases
|
|
100
192
|
|
|
101
193
|
```sh
|
|
102
|
-
ship
|
|
103
|
-
ship
|
|
104
|
-
ship db warehouse
|
|
194
|
+
ship check
|
|
195
|
+
ship release --tag 1.2.0 --no-env
|
|
105
196
|
```
|
|
106
197
|
|
|
107
|
-
The
|
|
108
|
-
|
|
109
|
-
`
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
- `
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
198
|
+
The release goes to `dist/ship/1.2.0` with a standalone Compose file, image
|
|
199
|
+
archives, their checksums, digest-pinned registry image references, and a
|
|
200
|
+
`release.json` manifest. If you configure deploy commands, Ship includes
|
|
201
|
+
`deploy-commands.sh`. With `--no-env`, provision runtime settings on the
|
|
202
|
+
destination. [Build, transfer, and deploy an app release](docs/deployment.md)
|
|
203
|
+
|
|
204
|
+
## HTTPS and reverse proxies
|
|
205
|
+
|
|
206
|
+
Use an HTTPS reverse proxy for public deployments. Create a Docker network for
|
|
207
|
+
it and set `externalNetwork` in `ship.json`. Ship attaches HTTP endpoints to
|
|
208
|
+
that network. Set `APP_URL` to the public HTTPS URL in `.env.production` and
|
|
209
|
+
configure the app's allowed hosts, forwarded headers, and WebSocket settings
|
|
210
|
+
as needed. [Reverse proxy and deployment setup](docs/deployment.md#https-and-external-networks)
|
|
211
|
+
|
|
212
|
+
## Development files and volumes
|
|
213
|
+
|
|
214
|
+
The development app mounts the project at `/app`. On Linux, Ship builds the
|
|
215
|
+
default development user with the host UID/GID so app commands can write to
|
|
216
|
+
the checkout. Use `ship init --defaults --no-host-user` for UID/GID 1000.
|
|
217
|
+
For Vite, enable the Node service and configure the dev server to listen on
|
|
218
|
+
`0.0.0.0`. [Frontend development](docs/build-environment.md#frontend-development)
|
|
219
|
+
|
|
220
|
+
Use a distinct project name and host ports for each checkout you run at the
|
|
221
|
+
same time. In the publishing wizard, select port `0` to let Docker choose an
|
|
222
|
+
available host port. Find the assigned port in `ship up` or `ship ps`.
|
|
223
|
+
|
|
224
|
+
Keep backups of database and other persistent volumes before running
|
|
225
|
+
`ship down --volumes` or changing providers. Use the database's own backup
|
|
226
|
+
and restore tools for live data. A portable release carries images and
|
|
227
|
+
configuration. Back up and move data separately. [Volumes and data](docs/deployment.md#volumes-and-data)
|
|
228
|
+
|
|
229
|
+
## Extending Ship
|
|
230
|
+
|
|
231
|
+
Add app-specific Docker settings in `docker-compose.override.yml` or
|
|
232
|
+
`docker-compose.production.override.yml`. For reusable service definitions,
|
|
233
|
+
register a trusted Ruby file in `extensions`. [Service extensions](docs/extensions.md)
|
|
234
|
+
|
|
235
|
+
## Architecture
|
|
236
|
+
|
|
237
|
+
`exe/ship` loads the command line from `lib/ship/cli.rb`. `setup.rb` collects
|
|
238
|
+
selections, `application.rb` adapts Ruby apps, and `services.rb` loads the
|
|
239
|
+
built-in catalog in `templates/services.json`. `project.rb`, `compose.rb`, and
|
|
240
|
+
`environment_files.rb` generate the stack and settings. `release.rb` exports
|
|
241
|
+
production bundles. The `schema/` files mirror the shared Ship contracts.
|
|
242
|
+
|
|
243
|
+
## Contributing
|
|
244
|
+
|
|
245
|
+
From this checkout, run the contract and terminal checks.
|
|
155
246
|
|
|
156
247
|
```sh
|
|
157
|
-
|
|
158
|
-
|
|
248
|
+
ruby test/contract.rb
|
|
249
|
+
ruby test/terminal.rb
|
|
159
250
|
```
|
|
160
251
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
## Verify changes
|
|
252
|
+
With Docker and the spec checkout's Node dependencies installed, run
|
|
253
|
+
`test/docker-smoke.sh ../com.ship.spec` to exercise a Rack app, ClickHouse, and a
|
|
254
|
+
portable production release. Run `test/framework-smoke.sh rails` in an isolated
|
|
255
|
+
Ruby gem environment to test a disposable Rails app. The same script accepts
|
|
256
|
+
`hanami`, `sinatra`, or `roda`. [Maintainer release guide](docs/releasing.md)
|
|
167
257
|
|
|
168
|
-
|
|
169
|
-
With Docker and the sibling spec's Node dependencies installed, run
|
|
170
|
-
`test/docker-smoke.sh ../com.ship.spec` for an end-to-end Rack and ClickHouse
|
|
171
|
-
test that checks the config and the exported release against the spec.
|
|
258
|
+
## License
|
|
172
259
|
|
|
173
|
-
|
|
174
|
-
project, or substitute `hanami`, `sinatra`, or `roda`. This test uses Bundler
|
|
175
|
-
and RubyGems on the host to prepare the throwaway application.
|
|
260
|
+
Ruby Ship is available under the MIT license. [License text](LICENSE.md)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Build and frontend settings
|
|
2
|
+
|
|
3
|
+
Ship uses `.env` and `.env.production` for runtime settings. Declare build-time
|
|
4
|
+
values separately in `ship.json`.
|
|
5
|
+
|
|
6
|
+
```json
|
|
7
|
+
{
|
|
8
|
+
"build": {
|
|
9
|
+
"publicEnv": { "VITE_API_URL": "https://api.example.com" },
|
|
10
|
+
"secrets": ["BUNDLE_GEMS__EXAMPLE__COM"],
|
|
11
|
+
"npmrc": true
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`publicEnv` values are available in development and as production asset build
|
|
17
|
+
arguments. Anything compiled into browser assets is public. Store private
|
|
18
|
+
values in `.ship-secrets/NAME` for the corresponding `secrets` entry.
|
|
19
|
+
In the example, `.ship-secrets/BUNDLE_GEMS__EXAMPLE__COM` supplies Bundler's
|
|
20
|
+
credentials for `gems.example.com` through a temporary BuildKit mount.
|
|
21
|
+
|
|
22
|
+
With `npmrc` enabled, place the registry configuration in
|
|
23
|
+
`.ship-secrets/npmrc`. Ship mounts the file for the production Node asset
|
|
24
|
+
installation and for development commands in the Node service when selected.
|
|
25
|
+
Keep that directory out of Git. Ship excludes it from the build context and
|
|
26
|
+
mounts credentials for the operations that need them.
|
|
27
|
+
|
|
28
|
+
Use `ship --verbose build` to inspect build output. A missing BuildKit secret
|
|
29
|
+
file fails the build. [Image build output](../README.md#image-build-output)
|
|
30
|
+
|
|
31
|
+
## Frontend development
|
|
32
|
+
|
|
33
|
+
Enable the Node service when the app uses a separate asset development server.
|
|
34
|
+
For Vite, configure it to listen on `0.0.0.0` and use the published host port
|
|
35
|
+
for browser connections and HMR. The Node service shares the source checkout
|
|
36
|
+
and stores `node_modules` in a named volume.
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
ship init --defaults --frontend node --publish-development app:3000,node:5173
|
|
40
|
+
ship up
|
|
41
|
+
ship npm ci
|
|
42
|
+
ship npm run dev -- --host 0.0.0.0
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Use the matching `ship npm`, `ship pnpm`, `ship yarn`, or `ship bun` command.
|
|
46
|
+
`ship package-manager pnpm VERSION` writes the selection to `ship.json`
|
|
47
|
+
and regenerates the templates. Update the app's lockfile when switching
|
|
48
|
+
package managers.
|
|
49
|
+
|
|
50
|
+
## Production assets
|
|
51
|
+
|
|
52
|
+
Use `ship init --defaults --node-assets` to build Node assets in the production
|
|
53
|
+
image. Ship detects `jsbundling-rails`, `cssbundling-rails`, and `vite_rails`
|
|
54
|
+
when the app has a `package.json`. Keep the corresponding lockfile in the app.
|
|
55
|
+
The manager comes from `ship.json`, the `packageManager` declaration in
|
|
56
|
+
`package.json`, or the project's lockfile. Set an exact `packageManagerVersion`
|
|
57
|
+
when you need to pin the tool independently.
|
|
58
|
+
|
|
59
|
+
Ruby Ship runs Rails asset precompilation for Propshaft or Sprockets. For an
|
|
60
|
+
app with Node assets and its own `build` script, Ship runs that script when the
|
|
61
|
+
Rails asset pipeline and Vite Ruby are absent. Apps serve their compiled
|
|
62
|
+
assets through their configured app server or reverse proxy.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Configuration and generated files
|
|
2
|
+
|
|
3
|
+
`ship.json` records the project name, framework and server, selected services,
|
|
4
|
+
app-owned processes, port publishing, and deployment commands. Run `ship init`
|
|
5
|
+
again to update an existing project or use `ship init --defaults` to apply
|
|
6
|
+
scripted choices. Run `ship check` after editing the configuration directly.
|
|
7
|
+
The shared schema provides editor help for the keys. [Ship configuration schema](https://github.com/ship-ecosystem/spec/blob/main/schemas/ship.schema.json)
|
|
8
|
+
|
|
9
|
+
## Generated files
|
|
10
|
+
|
|
11
|
+
| Path | Purpose |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `ship.json` | Project configuration shared by the team |
|
|
14
|
+
| `docker/ship/` | Dockerfiles, entrypoint, and service-specific files generated from the configuration |
|
|
15
|
+
| `docker-compose.generated.yml` | Development stack |
|
|
16
|
+
| `docker-compose.production.generated.yml` | Production stack used to build and release |
|
|
17
|
+
| `docker-compose.override.yml` | Optional development changes maintained by the app |
|
|
18
|
+
| `docker-compose.production.override.yml` | Optional production changes maintained by the app |
|
|
19
|
+
|
|
20
|
+
Ship regenerates its Dockerfiles and Compose models. Put Compose changes in the
|
|
21
|
+
override files and review the generated diff after updating Ruby Ship. Keep the
|
|
22
|
+
project name stable when you want to reuse existing named volumes.
|
|
23
|
+
|
|
24
|
+
## Environment files
|
|
25
|
+
|
|
26
|
+
| Path | Purpose |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `.env` | Local development defaults and app settings |
|
|
29
|
+
| `.env.example` | Shareable development defaults and placeholders |
|
|
30
|
+
| `.env.production` | Private runtime configuration for production |
|
|
31
|
+
| `.env.production.example` | Shareable template for production settings |
|
|
32
|
+
|
|
33
|
+
`ship init` shows changes for all four files. It updates generated connection
|
|
34
|
+
endpoints as services or names change, removes obsolete generated defaults, and
|
|
35
|
+
preserves custom values and comments. The example files use blank placeholders
|
|
36
|
+
for credentials. Review the examples before committing them and keep `.env`,
|
|
37
|
+
`.env.production`, and `.ship-secrets/` private.
|
|
38
|
+
|
|
39
|
+
A generated service hostname is for container-to-container traffic. For a host
|
|
40
|
+
client, use a published port. For a public browser URL, supply the provider's
|
|
41
|
+
public URL setting. [Service environment contract](https://github.com/ship-ecosystem/spec/blob/main/docs/service-environment.md)
|
|
42
|
+
|
|
43
|
+
## Port publishing
|
|
44
|
+
|
|
45
|
+
Choose endpoints separately for development and production. The selector uses
|
|
46
|
+
`SERVICE:CONTAINER_PORT`, for example `app:3000` or `clickhouse-warehouse:8123`.
|
|
47
|
+
Use the resource name in `portPublishing`, even if `serviceNames` sets a
|
|
48
|
+
different hostname. Host port values live in `.env` and `.env.production`.
|
|
49
|
+
Set `APP_PORT=0` or enter `0` in the wizard for an automatically assigned host
|
|
50
|
+
port. `ship ps` displays the resulting mapping.
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
ship init --defaults --publish-development app:3000 --publish-production none
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Development ports bind to `127.0.0.1`. Production published ports can be public.
|
|
57
|
+
Leave production publishing empty for services that receive traffic through a
|
|
58
|
+
Docker reverse proxy. [HTTPS and external networks](deployment.md#https-and-external-networks)
|
|
59
|
+
|
|
60
|
+
## Processes to run
|
|
61
|
+
|
|
62
|
+
Use **Processes to run** for commands that should run alongside the app. The
|
|
63
|
+
processes use the app image and receive its environment. Commands can be argv
|
|
64
|
+
arrays or shell strings. A process with an HTTP endpoint must listen on
|
|
65
|
+
`0.0.0.0` at its declared port. Set `urlSetting` to the environment key for its
|
|
66
|
+
public URL, and `health` for its optional readiness path.
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"processes": {
|
|
71
|
+
"worker": ["bundle", "exec", "sidekiq"],
|
|
72
|
+
"events": {
|
|
73
|
+
"command": ["bundle", "exec", "ruby", "bin/events"],
|
|
74
|
+
"http": { "port": 8080, "role": "websocket", "health": "/up", "urlSetting": "EVENTS_URL" }
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Use `ship logs --follow worker` to inspect a running process. Use
|
|
81
|
+
`ship init --defaults --remove-process worker` to remove it from the stack.
|
|
82
|
+
Store database migration or initialization commands in `deployCommands` so
|
|
83
|
+
they run as part of a deployment. [Deploy commands](deployment.md#deploy-commands)
|
|
84
|
+
|
|
85
|
+
## Service names
|
|
86
|
+
|
|
87
|
+
Select a primary provider under `services` and add more under
|
|
88
|
+
`additionalServices`. Set `serviceNames` to change Compose names shown in
|
|
89
|
+
`ship ps`, `ship logs`, and connection settings. Ship keeps named volume
|
|
90
|
+
identities when you rename a service. [Adding and renaming services](services.md#adding-and-renaming-services)
|
data/docs/deployment.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Production application releases
|
|
2
|
+
|
|
3
|
+
`ship build` builds the project-owned production images. `ship release` builds
|
|
4
|
+
and packages them for a destination with Docker and Compose. Use `--platform`
|
|
5
|
+
when the deployment host requires a different Linux architecture, and make
|
|
6
|
+
sure the project's gems and service images support it.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
ship check
|
|
10
|
+
ship release --tag 1.2.0 --platform linux/amd64 --no-env
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Use a tag that identifies the app release. To rebuild an existing release
|
|
14
|
+
directory, use `--force`. Keep runtime credentials in `.env.production`.
|
|
15
|
+
By default, the release carries them in `.env`. Pass `--no-env` to transfer
|
|
16
|
+
configuration and images separately from production credentials.
|
|
17
|
+
|
|
18
|
+
| Release path | Contents |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `docker-compose.yml` | Standalone production stack with digest-pinned registry images |
|
|
21
|
+
| `images/*.tar` | One archive per project-owned image |
|
|
22
|
+
| `release.json` | Platform, image checksums and references, environment keys, HTTP endpoints, services, and required networks |
|
|
23
|
+
| `deploy-commands.sh` | Optional one-off commands to run before startup |
|
|
24
|
+
| `.env` | Production settings, included unless `--no-env` is used |
|
|
25
|
+
| `README.md` | Commands for the exact images and services in the release |
|
|
26
|
+
|
|
27
|
+
## Transfer and start the release
|
|
28
|
+
|
|
29
|
+
Transfer the complete `dist/ship/1.2.0/` directory. On the destination, check the
|
|
30
|
+
image archive hashes against `release.json`, provision `.env` if needed, and
|
|
31
|
+
create any external networks listed in the manifest. From that directory, run
|
|
32
|
+
the commands in its generated `README.md`. Load local archives with
|
|
33
|
+
`docker load -i`, pull registry services, run the deploy script if present, and
|
|
34
|
+
start services with `docker compose up -d --wait`.
|
|
35
|
+
|
|
36
|
+
In CI, use a runner with Docker to build the release and store the generated
|
|
37
|
+
directory as the deployment artifact. Use `--no-env` and provide runtime
|
|
38
|
+
settings on the destination when the artifact is shared.
|
|
39
|
+
|
|
40
|
+
The destination uses the transferred images and Compose file. Application
|
|
41
|
+
source is already in the app image. Production overrides must remain portable.
|
|
42
|
+
Use named volumes for runtime data, bake app files into the image, and supply
|
|
43
|
+
runtime settings in `.env`. [Ship release contract](https://github.com/ship-ecosystem/spec/blob/main/docs/release-contract.md)
|
|
44
|
+
|
|
45
|
+
## Deploy commands
|
|
46
|
+
|
|
47
|
+
Store commands such as migrations in `deployCommands` or add them through
|
|
48
|
+
**Deploy commands** in the wizard. For Rails, for example, use the command below.
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
ship init --defaults --deploy-command 'bundle exec rails db:prepare'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`deploy-commands.sh` starts and waits for infrastructure before running each
|
|
55
|
+
command in a disposable container using the production app image. It stops on
|
|
56
|
+
failure. Keep migrations safe to rerun if a deployment is retried.
|
|
57
|
+
|
|
58
|
+
## HTTPS and external networks
|
|
59
|
+
|
|
60
|
+
Create a Docker network shared with your HTTPS reverse proxy. Configure the
|
|
61
|
+
proxy to join it, then use the same name in Ship.
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
docker network create ship-proxy
|
|
65
|
+
ship init --defaults --external-network ship-proxy --publish-production none
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Ship connects the app and declared HTTP endpoints to the external network.
|
|
69
|
+
Route to the app's effective Compose service name and container port. Give
|
|
70
|
+
services distinct names when multiple projects share a proxy network. Set the
|
|
71
|
+
production `APP_URL` and any public endpoint URLs such as `MERCURE_PUBLIC_URL`
|
|
72
|
+
for the app's public HTTPS addresses. The generated release README lists the
|
|
73
|
+
network setup before startup.
|
|
74
|
+
|
|
75
|
+
## Volumes and data
|
|
76
|
+
|
|
77
|
+
Named volumes are scoped to the Compose project. Find their names with
|
|
78
|
+
`docker volume ls --filter label=com.docker.compose.project=warehouse-app`,
|
|
79
|
+
substituting your `ship.json` project name. Use provider tools for consistent
|
|
80
|
+
backups and restore the data on the destination before shifting traffic. Stop
|
|
81
|
+
SQLite writers before copying the SQLite database or take a consistent SQLite
|
|
82
|
+
backup. Container recreation normally reuses volumes; `ship down --volumes`
|
|
83
|
+
removes them. The release format carries image archives and stack configuration,
|
|
84
|
+
so data transfer is a separate deployment step.
|
data/docs/releasing.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Releasing the Ruby Ship gem
|
|
2
|
+
|
|
3
|
+
A Ruby Ship gem release is distinct from the application bundles produced by
|
|
4
|
+
`ship release`. The gem version lives in `lib/ship/version.rb` and is read by
|
|
5
|
+
`ruby-ship.gemspec`. Git tags have a `v` prefix, for example `v0.1.1`.
|
|
6
|
+
|
|
7
|
+
1. Set the new version in `lib/ship/version.rb`. Run `ruby test/contract.rb`
|
|
8
|
+
and `ruby test/terminal.rb`.
|
|
9
|
+
2. Build the gem and test it with a project-scoped install or a temporary gem
|
|
10
|
+
directory. Check that `ship --version` matches the version in the gemspec.
|
|
11
|
+
3. Push the release commit to `main` and check Ruby Ship CI. It tests packaging
|
|
12
|
+
on Ruby 3.3, 3.4, and 4.0, along with the Docker release and framework smoke
|
|
13
|
+
tests.
|
|
14
|
+
4. Tag the tested commit and push the tag.
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
ship_version=$(ruby -r ./lib/ship/version -e 'print Ship::VERSION')
|
|
18
|
+
git tag -a "v$ship_version" -m "Ruby Ship $ship_version"
|
|
19
|
+
git push origin "v$ship_version"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
5. Build from the tagged source and publish with a RubyGems account authorized
|
|
23
|
+
to push `ruby-ship`. Publishing uses a manual `gem push`.
|
|
24
|
+
[RubyGems publishing guide](https://guides.rubygems.org/publishing/)
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
gem build ruby-ship.gemspec
|
|
28
|
+
gem push "ruby-ship-$ship_version.gem"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
6. Check the version on RubyGems, then install it in a project bundle and run
|
|
32
|
+
`bundle exec ship --version`. Use a new version for a follow-up release.
|
|
33
|
+
[Ruby Ship on RubyGems](https://rubygems.org/gems/ruby-ship)
|
data/docs/services.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Services for Ruby applications
|
|
2
|
+
|
|
3
|
+
Run `ship init` to choose one primary provider per service group. Ruby Ship
|
|
4
|
+
starts the selected containers and supplies connection settings. Your app
|
|
5
|
+
adds its own client gems and configures those clients to use the settings.
|
|
6
|
+
[Service catalog](../README.md#services) · [Shared environment contract](https://github.com/ship-ecosystem/spec/blob/main/docs/service-environment.md)
|
|
7
|
+
|
|
8
|
+
## Adding and renaming services
|
|
9
|
+
|
|
10
|
+
Add a service to an existing project by running `ship init` again or specifying
|
|
11
|
+
its group and provider on the command line.
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
ship init --defaults --service cache=redis
|
|
15
|
+
ship init --defaults --add database:clickhouse:warehouse
|
|
16
|
+
ship up
|
|
17
|
+
ship db warehouse
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The named ClickHouse service is `clickhouse-warehouse`. It gets an independent
|
|
21
|
+
volume and `WAREHOUSE_CLICKHOUSE_*` variables. If you change its Compose name,
|
|
22
|
+
use `serviceNames` with the original resource name. For example,
|
|
23
|
+
`"serviceNames": {"clickhouse-warehouse": "analytics-db"}` preserves its volume
|
|
24
|
+
identity and updates the app's connection settings. `ship db warehouse` still
|
|
25
|
+
uses the instance name.
|
|
26
|
+
|
|
27
|
+
ClickHouse exposes HTTP on 8123 and its native client protocol on 9000. Keep
|
|
28
|
+
both on the Compose network unless a host tool needs access. The primary
|
|
29
|
+
service supplies `CLICKHOUSE_HTTP_URL`, `CLICKHOUSE_HOST`, `CLICKHOUSE_PORT`,
|
|
30
|
+
`CLICKHOUSE_DB`, `CLICKHOUSE_USER`, and `CLICKHOUSE_PASSWORD`.
|
|
31
|
+
Set `WAREHOUSE_CLICKHOUSE_PASSWORD` in `.env.production` if you include the
|
|
32
|
+
named instance in production.
|
|
33
|
+
|
|
34
|
+
## Rails database setup
|
|
35
|
+
|
|
36
|
+
| Provider | Active Record adapter gem |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| SQLite | `sqlite3` |
|
|
39
|
+
| PostgreSQL | `pg` |
|
|
40
|
+
| MySQL or MariaDB | `mysql2` |
|
|
41
|
+
| SQL Server | `activerecord-sqlserver-adapter` |
|
|
42
|
+
|
|
43
|
+
Update your app's `Gemfile.lock` before starting a stack that uses the adapter.
|
|
44
|
+
For relational database services, Ruby Ship can assemble `DATABASE_URL` from
|
|
45
|
+
`DB_*` if the Rails app has not supplied its own URL. Keep adapter-specific
|
|
46
|
+
and multi-database settings in `config/database.yml`. For example, with
|
|
47
|
+
PostgreSQL installed in the bundle, run these commands.
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
ship init --defaults --database postgres
|
|
51
|
+
ship up
|
|
52
|
+
ship rails db:prepare
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
SQLite runs inside the Ruby process and uses a named volume at `/app/storage`.
|
|
56
|
+
Rails apps generated with SQLite already use that directory. For other apps,
|
|
57
|
+
read `SHIP_SQLITE_PATH` for the database file. `ship db` opens the selected
|
|
58
|
+
provider's database client. For MongoDB, `--mongodb-mode standalone` selects a
|
|
59
|
+
single server. The default single-member replica set enables transactions and
|
|
60
|
+
change streams on one server.
|
|
61
|
+
|
|
62
|
+
## Background workers
|
|
63
|
+
|
|
64
|
+
**Processes to run** suggests Solid Queue, GoodJob, or Sidekiq when detected in
|
|
65
|
+
`Gemfile.lock`. Solid Queue also needs `bin/jobs`. Enable a worker after
|
|
66
|
+
configuring its adapter and dependencies in the app.
|
|
67
|
+
|
|
68
|
+
- Solid Queue and GoodJob use the app's database configuration and migrations.
|
|
69
|
+
Run `ship rails db:prepare` to initialize a development database. Configure
|
|
70
|
+
any dedicated queue database and add the preparation command to `deployCommands`
|
|
71
|
+
for releases.
|
|
72
|
+
- Sidekiq can use the primary Redis or Valkey connection. A Redis or Valkey
|
|
73
|
+
service named `sidekiq` supplies a dedicated `SIDEKIQ_REDIS_URL`. Configure
|
|
74
|
+
the Sidekiq client and server to use that variable when provided.
|
|
75
|
+
|
|
76
|
+
## Real-time messaging
|
|
77
|
+
|
|
78
|
+
AnyCable is available for Rails apps with `anycable-rails` or
|
|
79
|
+
`anycable-rails-core` in the bundle. Ruby Ship configures its HTTP RPC endpoint
|
|
80
|
+
at `/_anycable`. Configure your Action Cable adapter and browser client, then
|
|
81
|
+
provide the production secret, public URL, and allowed origins. Centrifugo and
|
|
82
|
+
Mercure can serve other Ruby apps through their own client integrations.
|
|
83
|
+
|
|
84
|
+
## Other services
|
|
85
|
+
|
|
86
|
+
- Use Mailpit to catch development SMTP traffic. Ruby Ship supplies `MAIL_HOST`
|
|
87
|
+
and `MAIL_PORT`; configure your mailer to read them. Use your own production
|
|
88
|
+
SMTP settings in `.env.production`.
|
|
89
|
+
- For Garage, SeaweedFS, RustFS, or Silo, configure your S3 client (or Rails
|
|
90
|
+
Active Storage) to use the `AWS_*` settings and create the bucket before
|
|
91
|
+
uploading data. Check the provider's image requirements for your target
|
|
92
|
+
platform.
|
|
93
|
+
- Selenium and Playwright provide browser endpoints for the app's test client.
|
|
94
|
+
The app has the development network alias `ship-app.test`. Cypress can be
|
|
95
|
+
run with `ship test`. Mailpit, browser testing, and the development Node
|
|
96
|
+
service stay in the development stack.
|
|
97
|
+
- For a managed database, cache, or broker, leave that category unset and
|
|
98
|
+
supply the application's connection setting through its runtime environment.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Frameworks and Ruby servers
|
|
2
|
+
|
|
3
|
+
Run Ship at the root of a Rack-compatible application. It reads `.ruby-version`,
|
|
4
|
+
`Gemfile.lock`, and framework files to select defaults. Use `ship init --framework KEY`
|
|
5
|
+
to choose a framework explicitly.
|
|
6
|
+
|
|
7
|
+
| Key | Detection | Development with the default server |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `rails` | `bin/rails` and `config/application.rb` | `bin/rails server` on `0.0.0.0` |
|
|
10
|
+
| `hanami` | `config/app.rb` and the `hanami` gem | `hanami server` on `0.0.0.0` |
|
|
11
|
+
| `sinatra` | `sinatra` in `Gemfile.lock` | Puma running `config.ru` |
|
|
12
|
+
| `roda` | `roda` in `Gemfile.lock` | Puma running `config.ru` |
|
|
13
|
+
| `rack` | Generic Rack fallback | Puma running `config.ru` |
|
|
14
|
+
|
|
15
|
+
Hanami development reloads code when the project has a `Guardfile` and
|
|
16
|
+
`hanami-reloader` in its bundle. For Sinatra, Roda, and other Rack apps,
|
|
17
|
+
configure reloading in the app or restart the app container after code changes.
|
|
18
|
+
|
|
19
|
+
## Ruby and Bundler versions
|
|
20
|
+
|
|
21
|
+
Ruby Ship supports MRI branches 3.3, 3.4, and 4.0 in its Docker images. It uses
|
|
22
|
+
an exact version from `.ruby-version` or the `RUBY VERSION` in `Gemfile.lock`.
|
|
23
|
+
For a branch-only declaration it uses the patch version listed in the Ruby Ship
|
|
24
|
+
source. The default is the Ruby 3.4 branch. Update the app's pin and rebuild to
|
|
25
|
+
apply Ruby fixes. [Ruby patch versions](../lib/ship/application.rb)
|
|
26
|
+
|
|
27
|
+
Bundler comes from the `BUNDLED WITH` entry in `Gemfile.lock`. If you build or
|
|
28
|
+
deploy onto Linux, add the applicable lockfile platforms before generating or
|
|
29
|
+
building the stack.
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
bundle lock --add-platform x86_64-linux aarch64-linux
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Server profiles
|
|
36
|
+
|
|
37
|
+
| Profile | App gems | Behavior |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| `puma` | `puma` | Framework development command where available. Puma runs `config.ru` in production |
|
|
40
|
+
| `thruster` | `puma`, `thruster` | Rails development command. In production, Thruster publishes the app port and forwards to Puma on a private loopback port |
|
|
41
|
+
| `falcon` | `falcon` | Falcon serves the Rack app directly in both environments |
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
ship init --defaults --server falcon
|
|
45
|
+
ship up
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The default app port inside Docker is 3000. Change it with `ship init --port`
|
|
49
|
+
when the app requires a different container port. Ship probes the detected
|
|
50
|
+
Rails health route when available and uses a TCP check for other app servers.
|
|
51
|
+
Use the port publishing settings to change the host binding. [Port publishing](configuration.md#port-publishing)
|
|
52
|
+
|
|
53
|
+
Use `ship bundle`, `ship ruby`, or `ship rake` for container-side commands.
|
|
54
|
+
`ship rails` and `ship hanami` are available for their respective adapters.
|
data/lib/ship/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-ship
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ship Ecosystem contributors
|
|
@@ -16,7 +16,13 @@ extra_rdoc_files: []
|
|
|
16
16
|
files:
|
|
17
17
|
- LICENSE.md
|
|
18
18
|
- README.md
|
|
19
|
+
- docs/build-environment.md
|
|
20
|
+
- docs/configuration.md
|
|
21
|
+
- docs/deployment.md
|
|
19
22
|
- docs/extensions.md
|
|
23
|
+
- docs/releasing.md
|
|
24
|
+
- docs/services.md
|
|
25
|
+
- docs/standalone-runtimes.md
|
|
20
26
|
- exe/ship
|
|
21
27
|
- lib/ship.rb
|
|
22
28
|
- lib/ship/application.rb
|