-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (43 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
55 lines (43 loc) · 1.47 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
FROM ruby:4.0.1-alpine3.23
ARG KRANE_VERSION=3.9.1
ARG KUBECTL_VERSION=1.34.4
ENV BUNDLE_WITHOUT="development:test"
RUN apk update && apk --update add \
# libstdc++ \
ca-certificates \
tzdata \
mysql-client \
shared-mime-info \
nodejs \
yaml-dev
# Add AWS RDS CA bundle to the system trust store so that MariaDB Connector/C
# (which verifies server certificates by default since v3.4.0) can verify RDS connections.
ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/aws-rds-global-bundle.crt
RUN update-ca-certificates
COPY Gemfile /app/
COPY Gemfile.lock /app/
COPY .ruby-version /app/
RUN apk --update add \
--virtual build-dependencies \
build-base \
# openssl-dev \
mysql-dev \
libc-dev \
linux-headers \
git \
bash && \
cd /app ; bundle install && \
gem install krane -f --no-document --version=$KRANE_VERSION
COPY . /app
ADD https://dl.k8s.io/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl /usr/bin/kubectl
RUN chmod +x /usr/bin/kubectl
COPY kubeconfig.yml /root/.kube/config
COPY kubeconfig.yml /home/deploy/.kube/config
WORKDIR /app
# We need to use dummy DATABASE_URL to be able to precompile assets
# since it fails with no config/database.yml by default, but the
# DB connection is acutally no needed.
RUN RAILS_ENV=production DATABASE_URL=mysql2://dummy/dummy bin/rails assets:precompile
EXPOSE 3000
ENTRYPOINT ["bin/entrypoint.sh"]
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]