-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
53 lines (42 loc) · 1.23 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
FROM ruby:3.3.5-alpine3.20
ARG KRANE_VERSION=3.0.1
ARG KUBECTL_VERSION=1.26.3
RUN apk update && apk --update add \
ruby-io-console \
# libstdc++ \
tzdata \
mysql-client \
shared-mime-info \
nodejs
COPY Gemfile /app/
COPY Gemfile.lock /app/
COPY .ruby-version /app/
RUN apk --update add \
--virtual build-dependencies \
build-base \
ruby-dev \
# openssl-dev \
mysql-dev \
libc-dev \
linux-headers \
git \
openssh-client \
bash \
&& gem install bundler && \
cd /app ; bundle install --without development test && \
gem install krane -f --no-document --version=$KRANE_VERSION
COPY . /app
COPY root/ root/
RUN chmod -R 700 root/.ssh
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"]