-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (45 loc) · 1.55 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
52
53
54
55
56
57
58
# syntax = docker/dockerfile:1
# ----------------------------------------------------------------------------------------------------------------------------
# Base build stage for building gems
ARG RUBY_VERSION=3.3.4
FROM registry.docker.com/library/ruby:$RUBY_VERSION as base
WORKDIR /rails
ENV BUNDLE_PATH="/usr/local/bundle"
FROM base as build
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
build-essential \
git \
pkg-config \
libpq-dev \
libz-dev \
dh-autoreconf
COPY Gemfile Gemfile.lock ./
RUN bundle config set --local frozen false && \
bundle install && \
rm -rf ~/.bundle/ \
"${BUNDLE_PATH}"/ruby/*/cache \
"${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
COPY . .
# ----------------------------------------------------------------------------------------------------------------------------
# Final stage for app image
FROM base
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
curl \
libpq-dev \
libz-dev \
dh-autoreconf \
postgresql-client \
neovim \
xz-utils && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Include FFMPEG (Video processing)
# https://johnvansickle.com/ffmpeg/
RUN curl -L https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz | tar -xJ && \
mv ffmpeg-*-amd64-static/ffmpeg /usr/local/bin/ffmpeg && \
mv ffmpeg-*-amd64-static/ffprobe /usr/local/bin/ffprobe && \
rm -rf ffmpeg-*-amd64-static
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
EXPOSE 3000
CMD ["./bin/rails", "server"]