Skip to content

Commit 3ab6c36

Browse files
eggplantshsbt
authored andcommitted
Add compose file
1 parent 85a532e commit 3ab6c36

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
## Building image ##
22
FROM ruby:3.0.3-slim-bullseye AS builder
3-
WORKDIR /app
43
# install build dependencies
54
RUN apt update && apt install make gcc g++ libffi-dev nodejs git -y
6-
COPY . .
5+
COPY ./Gemfile /app/Gemfile
6+
COPY ./Gemfile.lock /app/Gemfile.lock
7+
WORKDIR /app
78
RUN bundle install
89
EXPOSE 4567
9-
CMD ["bin/middleman", "serve"]
10+
CMD ["bin/middleman", "serve"]

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ where you can learn the Ruby language. Starting from zero knowledge about
55
programming you can learn the basics of Ruby in 56 short lessons.
66

77
## Credits
8+
89
Try Ruby version 1 by _why the lucky stiff_
910
Try Ruby version 2 by _Andrew McElroy & David Miani_
1011
Try Ruby version 3 by _Eric Allam & Nick Walsh_
@@ -13,6 +14,7 @@ Try Ruby version 4 by _Ivo Herweijer_
1314
This website is partially based on OpalRb.com by _Adam Beynon_.
1415

1516
### Translations
17+
1618
Spanish translation by _Jesus Gabriel y Galan_ & _Pablo García_
1719
Dutch translation by [_Ivo Herweijer_](https://github.com/easydatawarehousing)
1820
Brazilian Portuguese translation by [_Ricardo da Verdade Silva_](https://github.com/ricardovsilva)
@@ -31,20 +33,23 @@ not the json files in folder _source_.
3133
These files will be updated automatically by the build/publish task.
3234

3335
## Frontend website
36+
3437
The TryRuby is kind of unique in a way, that it is a frontend application created
3538
in Ruby with [Opal](https://opalrb.com/). The source code for this application is
3639
located in `app` directory.
3740

3841
## Docker
42+
3943
You can deploy the website using docker by running the following commands:
44+
4045
```
41-
# creating the image
42-
docker build -f Dockerfile . -t tryruby
43-
# running the image, you can access tryruby on http://localhost:9099
44-
docker run -p 9099:4567 -d tryruby:latest
46+
docker compose up
4547
```
4648

49+
Then visit `http://localhost:9099`.
50+
4751
## Preparing
52+
4853
Clone this repo, and use bundler to get dependencies:
4954

5055
$ bundle install
@@ -70,9 +75,11 @@ Git branch 'gh-pages' now holds the publishable version of TryRuby, accessible
7075
via [try.ruby-lang.org/](https://try.ruby-lang.org/).
7176

7277
## Translators
78+
7379
When adding a new translation: see the README file in /translations.
7480

7581
## Why
82+
7683
See the website [try-ruby-version-4](https://try.ruby-lang.org/articles/try-ruby-version-4/)
7784
for more background information on how and why this website was created.
7885

compose.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
web:
3+
build: .
4+
image: tryruby:latest
5+
ports:
6+
- "9099:4567"
7+
volumes:
8+
- .:/app

0 commit comments

Comments
 (0)