-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
56 lines (38 loc) · 1.53 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
# This Dockerfile produces a production ready image of talos-manager.
ARG RUBY_VERSION=3.3.5
FROM ruby:${RUBY_VERSION}-slim as base
WORKDIR /app
ENV BUNDLE_PATH=vendor/bundle
ENV BUNDLE_WITHOUT=development:test
ENV BUNDLE_CLEAN=true
FROM base as talosctl
RUN apt-get update -qq && apt-get install --no-install-recommends -y wget
ARG TALOS_VERSION=1.8.2
# TODO: This should use TARGETPLATFORM to determine the correct binary to download
RUN wget https://github.com/siderolabs/talos/releases/download/v${TALOS_VERSION}/talosctl-linux-amd64 -O /usr/local/bin/talosctl
RUN chmod +x /usr/local/bin/talosctl
FROM base as gems
# git for git based Gemfile definitions
# build-essential + pkg-config for native extensions
# libpq-dev for pg gem
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential pkg-config git libpq-dev
COPY .ruby-version .
COPY Gemfile* ./
RUN bundle install
RUN rm -rf vendor/bundle/ruby/*/cache
FROM base
# wget for talosctl installation
# curl is required for typhoeus and the heroku release command output
# libsqlite3-0 for sqlite3
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y wget curl libsqlite3-0 postgresql-client file && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
COPY --from=gems /app /app
COPY --from=talosctl /usr/local/bin/talosctl /usr/local/bin/talosctl
COPY . .
ENV RAILS_ENV=production
# Required to boot but not used for asset precompilation
ENV SECRET_KEY_BASE=foo
RUN bundle exec rails assets:precompile
CMD ["bin/rails", "server"]