Repository navigation
Expand file tree
/
Copy pathdev.Dockerfile
More file actions
73 lines (63 loc) · 2.17 KB
/
Copy pathdev.Dockerfile
File metadata and controls
73 lines (63 loc) · 2.17 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Build libheif from source
FROM ruby:3.4.3-slim AS libheif-build
ARG LIBHEIF_VERSION=1.23.2
ARG LIBHEIF_SHA256=1405ed070421459b569ff49deab109b7f1a30a447e72a9b20a4154f774634a44
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
build-essential cmake pkg-config curl ca-certificates \
libaom-dev libde265-dev && \
rm -rf /var/lib/apt/lists/* && \
cd /tmp && \
curl -sL "https://github.com/strukturag/libheif/archive/refs/tags/v${LIBHEIF_VERSION}.tar.gz" -o /tmp/libheif.tar.gz && \
echo "${LIBHEIF_SHA256} /tmp/libheif.tar.gz" | sha256sum -c - && \
tar xz -C /tmp/ -f /tmp/libheif.tar.gz && \
cd /tmp/libheif-${LIBHEIF_VERSION} && \
mkdir build && cd build && \
cmake --preset=release -DWITH_EXAMPLES=ON -DENABLE_PLUGIN_LOADING=NO .. && \
make -j$(nproc) && \
make install && \
ldconfig
FROM ruby:3.4.3
# Install system dependencies
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
--mount=target=/var/cache/apt,type=cache,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update -qq && \
apt-get install --no-install-recommends -y \
build-essential \
git \
libpq-dev \
libyaml-dev \
postgresql-client \
libvips \
pkg-config \
curl \
vim \
imagemagick \
libffi-dev \
libopenblas-dev \
liblapack-dev \
ffmpeg \
gettext-base
# Overlay libheif from build stage
COPY --from=libheif-build /usr/local/lib/libheif* /usr/local/lib/
COPY --from=libheif-build /usr/local/bin/heif-* /usr/local/bin/
COPY --from=libheif-build /usr/local/include/libheif /usr/local/include/libheif
RUN ldconfig
ENV LD_LIBRARY_PATH="/usr/local/lib"
# Install Node.js and Yarn
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
npm install --global yarn
# Set working directory
WORKDIR /app
# Install application gems
COPY Gemfile Gemfile.lock ./
RUN bundle install
# Add a script to be executed every time the container starts
COPY entrypoint.dev.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.dev.sh
ENTRYPOINT ["entrypoint.dev.sh"]
EXPOSE 3000
# Start the main process
CMD ["bundle", "exec", "bin/dev"]