Skip to content

Commit 9ce1a95

Browse files
committed
Add Dockerfile and update gemspec definition
1 parent d163711 commit 9ce1a95

File tree

6 files changed

+68
-8
lines changed

6 files changed

+68
-8
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.git
2+
/deployment
3+
.*.swp

board-linuxfr.gemspec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ require './lib/board-linuxfr/version'
66
Gem::Specification.new do |s|
77
s.name = "board-linuxfr"
88
s.version = BoardLinuxfr::VERSION
9-
s.authors = ["Bruno Michel"]
10-
s.email = "[email protected]"
9+
s.authors = ["Bruno Michel", "Adrien Dorsaz"]
10+
s.email = "[email protected]"
1111
s.homepage = "https://github.com/linuxfrorg/board-sse-linuxfr.org"
1212
s.summary = "Push notifications for the board of LinuxFr.org via Server-Sent Events"
1313
s.description = "Push notifications for the board of LinuxFr.org via Server-Sent Events"
1414

15-
s.files = `git ls-files bin lib`.split("\n")
15+
s.files = Dir['lib/**/*.rb'] + Dir['bin/*']
1616
s.platform = Gem::Platform::RUBY
1717
s.executables = ["board-linuxfr"]
1818
s.require_path = 'lib'
1919

20-
s.add_dependency "goliath", "~>1.0"
21-
s.add_dependency "hiredis", "~>0.4"
22-
s.add_dependency "redis", "~>3.0"
23-
s.add_dependency "yajl-ruby", "~>1.2"
20+
s.add_runtime_dependency "goliath", "~>1.0", ">= 1.0.7"
21+
s.add_runtime_dependency "hiredis", "~>0.4"
22+
s.add_runtime_dependency "redis", "~>3.0"
23+
s.add_runtime_dependency "yajl-ruby", "~>1.2"
2424

2525
s.add_development_dependency "minitest", "~>2.3"
2626
end

deployment/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM ruby:3-slim-bookworm
2+
3+
LABEL org.opencontainers.image.title="LinuxFr.org boards"
4+
LABEL org.opencontainers.image.description="Chat rooms for LinuxFr"
5+
LABEL org.opencontainers.image.source="https://github.com/linuxfrorg/board-sse-linuxfr.org"
6+
LABEL org.opencontainers.image.url="https://github.com/linuxfrorg/board-sse-linuxfr.org"
7+
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
8+
LABEL org.opencontainers.image.version="ruby3-bookworm"
9+
LABEL org.opencontainers.image.authors="Adrien Dorsaz <[email protected]>"
10+
11+
ARG UID=1200
12+
13+
RUN apt-get update \
14+
# Install dependencies \
15+
&& apt-get install -y --no-install-recommends \
16+
build-essential ruby ruby-dev \
17+
&& apt-get clean
18+
19+
USER ${UID}
20+
WORKDIR /linuxfr-board
21+
ENV HOME=/linuxfr-board
22+
23+
# Install board-linuxfr
24+
COPY --chown=${UID}:0 --chmod=770 . .
25+
RUN gem build board-linuxfr.gemspec \
26+
&& gem install ./board-linuxfr-*.gem
27+
28+
# Clean development dependencies
29+
USER 0
30+
RUN apt purge --autoremove -y build-essential ruby-dev
31+
32+
USER ${UID}
33+
EXPOSE 9000
34+
35+
CMD ["board-linuxfr"]
36+

deployment/default.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REDIS_HOST=redis
2+
REDIS_PORT=6379
3+
REDIS_URL=redis://redis:6379/0

docker-compose.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
services:
2+
linuxfr-board:
3+
build:
4+
context: .
5+
dockerfile: ./deployment/Dockerfile
6+
env_file:
7+
- deployment/default.env
8+
depends_on:
9+
- redis
10+
11+
redis:
12+
image: redis:5
13+
volumes:
14+
- data-redis:/data
15+
16+
volumes:
17+
data-redis:
18+
driver: local

lib/board-linuxfr/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class BoardLinuxfr
2-
VERSION = "0.1.3"
2+
VERSION = "0.1.4"
33
end

0 commit comments

Comments
 (0)