|
1 |
| -FROM debian:stretch-slim |
| 1 | +FROM debian:bookworm-slim |
2 | 2 |
|
3 |
| -LABEL maintainer= "[email protected]" |
4 |
| -LABEL version="1.0" |
5 |
| -LABEL description="Run LinuxFr.org Ruby on Rails website" |
| 3 | +LABEL org.opencontainers.image.title="LinuxFr.org website" |
| 4 | +LABEL org.opencontainers.image.description="Run LinuxFr.org Ruby on Rails website" |
| 5 | +LABEL org.opencontainers.image.source="https://github.com/linuxfrorg/linuxfr.org" |
| 6 | +LABEL org.opencontainers.image.url="https://github.com/linuxfrorg/linuxfr.org/blob/master/Docker.md" |
| 7 | +LABEL org.opencontainers.image.licenses="AGPL-3.0-only" |
| 8 | +LABEL org.opencontainers.image.version="rails7-bookworm" |
| 9 | +LABEL org.opencontainers.image.authors= "Adrien Dorsaz <[email protected]>" |
6 | 10 |
|
7 |
| -WORKDIR /linuxfr.org |
| 11 | +ARG UID=1200 |
8 | 12 |
|
9 | 13 | # Install system dependencies
|
10 |
| -# Debian Stretch has been archived so we replace the sources with the archived ones |
11 |
| -RUN echo 'deb http://archive.debian.org/debian stretch main' > '/etc/apt/sources.list' \ |
12 |
| - && echo 'deb http://archive.debian.org/debian stretch-proposed-updates main' >> '/etc/apt/sources.list' \ |
13 |
| - && echo 'deb http://archive.debian.org/debian stretch-backports main' >> '/etc/apt/sources.list.d/linuxfr.list' \ |
14 |
| - && apt-get update \ |
| 14 | +RUN apt-get update \ |
15 | 15 | && apt-get install -y --no-install-recommends --allow-downgrades \
|
16 |
| - mysql-client libmysql++-dev git \ |
17 |
| - build-essential openssl libreadline-dev curl libcurl4-openssl-dev zlib1g=1:1.2.8.dfsg-5 \ |
| 16 | + mariadb-client libmariadb++-dev git \ |
| 17 | + build-essential openssl libreadline-dev curl libcurl4-openssl-dev zlib1g \ |
18 | 18 | zlib1g-dev libssl-dev libxml2-dev libxslt-dev autoconf libgmp-dev libyaml-dev \
|
19 | 19 | ncurses-dev bison automake libtool imagemagick libc6-dev hunspell \
|
20 | 20 | hunspell-fr-comprehensive ruby ruby-dev ruby-rack \
|
21 |
| - && gem install bundler -v 1.17.3 \ |
| 21 | + nodejs npm \ |
| 22 | + && gem install bundler -v 2.4.20 \ |
22 | 23 | && apt-get clean
|
23 | 24 |
|
24 |
| -RUN mkdir /home/linuxfr.org |
25 |
| -ENV HOME /home/linuxfr.org |
| 25 | +USER ${UID} |
| 26 | +ENV HOME=/linuxfr.org |
| 27 | +WORKDIR /linuxfr.org |
26 | 28 |
|
27 | 29 | # Install external dependencies
|
28 |
| -COPY Gemfile* ./ |
| 30 | +COPY --chown=${UID}:0 --chmod=770 Gemfile* ./ |
29 | 31 |
|
30 | 32 | RUN bundle config set path 'vendor/bundle' \
|
31 | 33 | && bundle config set deployment 'true' \
|
32 | 34 | && bundle install
|
33 | 35 |
|
34 | 36 | # Configure the application
|
35 |
| -COPY deployment/linuxfr.org/database.yml config/database.yml |
36 |
| -COPY config/secrets.yml.sample config/secrets.yml |
| 37 | +COPY --chown=${UID}:0 --chmod=770 deployment/linuxfr.org/database.yml config/database.yml |
| 38 | +COPY --chown=${UID}:0 --chmod=770 config/secrets.yml.sample config/secrets.yml |
37 | 39 |
|
38 | 40 | # Bundle source code
|
39 |
| -COPY . /linuxfr.org |
| 41 | +COPY --chown=${UID}:0 --chmod=770 . /linuxfr.org |
40 | 42 |
|
41 | 43 | EXPOSE 3000
|
42 | 44 |
|
| 45 | +# Workaround for EACCESS error while running assets.rb |
| 46 | +USER 0 |
| 47 | + |
43 | 48 | CMD ["bin/rails", "server", "--binding", "0.0.0.0"]
|
44 | 49 |
|
0 commit comments