forked from siw36/onetimesecret
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (36 loc) · 1.01 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
FROM ruby:2.6-buster
# Dependencies
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
ntp \
curl \
tar \
bzip2 \
openssl \
build-essential \
libyaml-dev \
libevent-dev \
zlib1g \
zlib1g-dev \
libssl-dev \
libxml2 \
libreadline-gplv2-dev \
&& gem install bundler
# OTS
RUN mkdir -p /var/log/onetime /var/run/onetime /var/lib/onetime /etc/onetime /source/onetime
COPY . /source/onetime
RUN cd /source/onetime \
&& bundle install --frozen --deployment --without=dev \
&& gem update \
&& bin/ots init \
&& cp -R etc/* /etc/onetime
# Entrypoint
COPY entrypoint.sh /entrypoint.sh
# Permissions
RUN chown -R 0 /entrypoint.sh /var/log/onetime /var/run/onetime /var/lib/onetime /etc/onetime /source/onetime \
&& chmod -R g=u /entrypoint.sh /var/log/onetime /var/run/onetime /var/lib/onetime /etc/onetime /source/onetime \
&& chmod -R 770 /entrypoint.sh /source/onetime/bin
EXPOSE 7143
USER 1001
WORKDIR /source/onetime
ENTRYPOINT ["/entrypoint.sh"]