-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (34 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
FROM ruby:3.2.0-slim-buster
LABEL maintainer "[email protected]"
ENV GOSU_VERSION 1.11
ENV APP_ROOT /var/www/tree-planter
RUN mkdir -p $APP_ROOT
WORKDIR $APP_ROOT
RUN apt-get update -qq \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends dirmngr gcc git make gnupg2 openssh-client ruby-dev wget sendmail \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg2 --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg2 --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true
ADD Gemfile* $APP_ROOT/
RUN gem install bundler && bundle install --jobs=3
ADD . $APP_ROOT
COPY config-example.json $APP_ROOT/config.json
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
# SSH Setup
RUN mkdir -p /home/user/.ssh \
&& printf "Host *\n\tStrictHostKeyChecking no\n" >> /home/user/.ssh/config \
&& chmod 700 /home/user/.ssh \
&& chmod 644 /home/user/.ssh/config
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 8080
CMD ["bundle", "exec", "passenger", "start", "--port", "8080"]