Skip to content

Commit 676b4c7

Browse files
committed
Update nginx config and docker files to use Debian Bookworm with Ruby 3.1
Nginx proxy needed update on buffer size to avoid error about "upstream sent too big header".
1 parent 11eef3c commit 676b4c7

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
/uploads
2424
/vendor/ruby
2525
/vendor/bundle
26+
/coverage

db/schema.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
t.index ["user_id"], name: "index_nodes_on_user_id"
206206
end
207207

208-
create_table "oauth_access_grants", id: :integer, charset: "utf8mb3", force: :cascade do |t|
208+
create_table "oauth_access_grants", id: :integer, charset: "utf8", force: :cascade do |t|
209209
t.integer "resource_owner_id", null: false
210210
t.integer "application_id", null: false
211211
t.string "token", null: false
@@ -219,7 +219,7 @@
219219
t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true
220220
end
221221

222-
create_table "oauth_access_tokens", id: :integer, charset: "utf8mb3", force: :cascade do |t|
222+
create_table "oauth_access_tokens", id: :integer, charset: "utf8", force: :cascade do |t|
223223
t.integer "resource_owner_id"
224224
t.integer "application_id", null: false
225225
t.string "token", null: false
@@ -234,7 +234,7 @@
234234
t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true
235235
end
236236

237-
create_table "oauth_applications", id: :integer, charset: "utf8mb3", force: :cascade do |t|
237+
create_table "oauth_applications", id: :integer, charset: "utf8", force: :cascade do |t|
238238
t.string "name", null: false
239239
t.string "uid", null: false
240240
t.string "secret", null: false

deployment/linuxfr-board/Dockerfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM docker.io/ruby:2-slim-buster
1+
FROM docker.io/ruby:3-slim-bookworm
22

33
LABEL org.opencontainers.image.title="Board for LinuxFr.org"
44
LABEL org.opencontainers.image.description="Users of the LinuxFr.org website can chat on a space called the board (« la tribune » in french). \
55
This Ruby daemon notifies the users when something is said with Server-Sent Event / EventSource."
66
LABEL org.opencontainers.image.source="https://github.com/linuxfrorg/board-sse-linuxfr.org"
7-
LABEL org.opencontainers.image.url="https://github.com/linuxfrorg/board-sse-linuxfr.org"
7+
LABEL org.opencontainers.image.url="https://github.com/linuxfrorg/linuxfr.org/blob/master/Container.md"
88
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
9-
LABEL org.opencontainers.image.version="1.1"
9+
LABEL org.opencontainers.image.version="ruby3-bookworm"
1010
LABEL org.opencontainers.image.authors="Adrien Dorsaz <[email protected]>"
1111

1212
ARG UID=1200
@@ -27,11 +27,17 @@ WORKDIR /linuxfr-board
2727
ENV HOME=/linuxfr-board
2828

2929
# Install board-linuxfr
30-
RUN gem install board-linuxfr -v '~> 0.1.3'
30+
# RUN gem install board-linuxfr -v '~> 0.1.4'
31+
32+
# Temporary build board-linuxfr from sources
33+
RUN git clone https://github.com/linuxfrorg/board-sse-linuxfr.org.git --branch ruby3 \
34+
&& cd board-sse-linuxfr.org \
35+
&& gem build board-linuxfr.gemspec \
36+
&& gem install ./board-linuxfr-*.gem
3137

3238
# Clean development dependencies
3339
USER 0
34-
RUN apt-get purge --autoremove -y build-essential ruby-dev
40+
RUN apt-get purge --autoremove -y build-essential git ruby-dev
3541

3642
USER ${UID}
3743
EXPOSE 9000

deployment/linuxfr-img/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LABEL org.opencontainers.image.description="Store external images into a cache t
55
LABEL org.opencontainers.image.source="https://github.com/linuxfrorg/img-LinuxFr.org"
66
LABEL org.opencontainers.image.url="https://github.com/linuxfrorg/linuxfr.org/blob/master/Container.md"
77
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
8-
LABEL org.opencontainers.image.version="2.1"
8+
LABEL org.opencontainers.image.version="rails7-bullseye"
99
LABEL org.opencontainers.image.authors="Adrien Dorsaz <[email protected]>"
1010

1111
ARG UID=1200

deployment/linuxfr.org/Dockerfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM docker.io/debian:bullseye-slim
1+
FROM docker.io/debian:bookworm-slim
22

33
LABEL org.opencontainers.image.title="LinuxFr.org website"
44
LABEL org.opencontainers.image.description="Run LinuxFr.org Ruby on Rails website"
55
LABEL org.opencontainers.image.source="https://github.com/linuxfrorg/linuxfr.org"
66
LABEL org.opencontainers.image.url="https://github.com/linuxfrorg/linuxfr.org/blob/master/Docker.md"
77
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
8-
LABEL org.opencontainers.image.version="2.0"
8+
LABEL org.opencontainers.image.version="rails7-bookworm"
99
LABEL org.opencontainers.image.authors="Adrien Dorsaz <[email protected]>"
1010

1111
ARG UID=1200
@@ -21,7 +21,7 @@ RUN \
2121
zlib1g-dev libssl-dev libxml2-dev libxslt-dev autoconf libgmp-dev libyaml-dev \
2222
ncurses-dev bison automake libtool imagemagick libc6-dev hunspell \
2323
hunspell-fr-comprehensive ruby ruby-dev ruby-rack; \
24-
gem install bundler -v 1.17.3; \
24+
gem install bundler -v 2.4.20; \
2525
apt-get clean
2626

2727
USER ${UID}
@@ -31,16 +31,12 @@ WORKDIR /linuxfr.org
3131
# Install external dependencies
3232
COPY --chown=${UID}:0 --chmod=770 Gemfile* ./
3333

34-
USER 0
3534
RUN \
3635
set -eux; \
3736
IFS=$'\n\t'; \
3837
bundle config set path 'vendor/bundle'; \
3938
bundle config set deployment 'true'; \
40-
bundle install; \
41-
chown ${UID}:0 -R .;
42-
43-
USER ${UID}
39+
bundle install;
4440

4541
# Configure the application
4642
COPY --chown=${UID}:0 --chmod=770 deployment/linuxfr.org/database.yml config/database.yml

deployment/nginx/templates/dlfp.conf.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ server {
2929
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3030
proxy_set_header Host $http_host;
3131
proxy_redirect off;
32+
proxy_buffers 8 16k;
33+
proxy_buffer_size 32k;
3234
proxy_pass http://linuxfr.org:3000;
3335
}
3436
}

0 commit comments

Comments
 (0)