Skip to content

Commit

Permalink
Merge pull request #50 from highmobility/ds-update-libs-and-improve-r…
Browse files Browse the repository at this point in the history
…eadme

Improve Example app
  • Loading branch information
scudelletti authored Sep 24, 2024
2 parents 49e103c + fdad00a commit 1ee4fdd
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 39 deletions.
5 changes: 2 additions & 3 deletions examples/sample-app/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.1-alpine
FROM ruby:3.3-alpine

WORKDIR /app

Expand All @@ -10,5 +10,4 @@ COPY src /app

EXPOSE 9292

ENTRYPOINT /bin/sh
CMD /app/web.sh
CMD ["/app/web.sh"]
4 changes: 2 additions & 2 deletions examples/sample-app/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.1-alpine
FROM ruby:3.3-alpine

WORKDIR /app

Expand All @@ -8,4 +8,4 @@ COPY src/Gemfile.lock /app/Gemfile.lock
RUN bundle install
COPY src /app

ENTRYPOINT /app/worker.sh
CMD ["/app/worker.sh"]
37 changes: 37 additions & 0 deletions examples/sample-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Images
### Build Images
```sh
docker build -f Dockerfile.web . -t sample-app:web
docker build -f Dockerfile.worker . -t sample-app:worker
docker build -f Dockerfile.worker . -t sample-app:migration
```

### Run Containers
```sh
docker run -it -p 9292:9292 sample-app:web
docker run -it sample-app:worker
docker run -it sample-app:migration
```

## Helm
### Deploy
```sh
helm install sample-app-web helm-web/
helm install sample-app-worker helm-worker/
```

## Application
### Server
```sh
rackup --host 0.0.0.0
```

### Worker
```sh
ruby worker.rb
```

### Migration
```sh
ruby migration.rb
```
6 changes: 3 additions & 3 deletions examples/sample-app/helm-web/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: hm-basic-webapp
repository: file://../../../hm-basic-webapp
version: 3.10.0
digest: sha256:53ac375c63e33f2947f6565337344b3e5ff8e0e595a3c2cc0854a36772b194bd
generated: "2024-04-09T14:04:26.389941+02:00"
version: 3.10.1
digest: sha256:b23e0903f20dfaa439a716a1d2bb13d4ca03cdf13d449d82c5b428a63f2f7ffe
generated: "2024-09-24T08:36:14.006075+02:00"
2 changes: 1 addition & 1 deletion examples/sample-app/helm-web/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ appVersion: "1.16.0"

dependencies:
- name: hm-basic-webapp
version: 3.10.0
version: 3.10.1
repository: file://../../../hm-basic-webapp
6 changes: 3 additions & 3 deletions examples/sample-app/helm-web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ hm-basic-webapp:
replicas: 1

ci:
deploymentTag: foo
deploymentMigrationTag: bar
deploymentTag: web
deploymentMigrationTag: migration

ingress:
enabled: false
Expand All @@ -42,7 +42,7 @@ hm-basic-webapp:
migration:
enabled: true
image:
repository: sample-migration
repository: sample-app
command:
- ruby
- migration.rb
Expand Down
7 changes: 4 additions & 3 deletions examples/sample-app/src/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
GEM
remote: https://rubygems.org/
specs:
rack (3.0.8)
rack (3.1.7)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
webrick (1.8.1)
webrick (1.8.2)

PLATFORMS
x86_64-darwin-22
x86_64-darwin-23

DEPENDENCIES
rackup (~> 2.1)

BUNDLED WITH
2.4.10
2.5.19
24 changes: 0 additions & 24 deletions examples/sample-app/src/README.md

This file was deleted.

0 comments on commit 1ee4fdd

Please sign in to comment.