-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
Dockerfile
51 lines (42 loc) · 1.8 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# https://hub.docker.com/r/stefansundin/rssbox
# docker pull stefansundin/rssbox
# docker run -i -t -p 3000:3000 stefansundin/rssbox
# docker run -i -t --entrypoint bin/cons stefansundin/rssbox
# docker network create rssbox
# docker run --rm --network=rssbox --name=redis redis redis-server --appendonly yes
# docker run --rm --network=rssbox --name=rssbox --env-file=.dockerenv -i -t -p 3000:3000 stefansundin/rssbox
# docker run --rm --network=rssbox -t redis redis-cli -h redis monitor
# Simple build:
# docker build --pull --progress plain -t stefansundin/rssbox .
# Multi-arch:
# docker buildx create --use --name multiarch --node multiarch0
# docker buildx build --pull --push --progress plain --platform linux/amd64,linux/arm64,linux/arm/v7 -t stefansundin/rssbox .
# Push to public ECR:
# docker buildx imagetools create -t public.ecr.aws/stefansundin/rssbox stefansundin/rssbox
FROM stefansundin/ruby:3.3-jemalloc
LABEL org.opencontainers.image.authors="Stefan Sundin"
LABEL org.opencontainers.image.url="https://github.com/stefansundin/rssbox"
# install system utilities that are useful when debugging
RUN \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
vim less && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN bundle config set --local without development:test
RUN bundle config set --local deployment 'true'
RUN bundle install --retry=3 --jobs=4
COPY . .
RUN find -not -path './vendor/*'
# Disable irb history to prevent .irb_history permission error from showing
RUN echo "IRB.conf[:SAVE_HISTORY] = nil" >> .irbrc
# Run the container as an unprivileged user
RUN mkdir -p tmp
RUN chown nobody:nogroup tmp
USER nobody:nogroup
EXPOSE 3000
ENV PORT=3000
ENTRYPOINT ["bundle", "exec", "puma", "-C", "config/puma.rb"]