-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
65 lines (50 loc) · 1.75 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
57
58
59
60
61
62
63
64
65
FROM phusion/baseimage:noble-1.0.0
SHELL ["/bin/bash", "-lc"]
RUN apt-get update && apt-get install -y ca-certificates
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
RUN echo -e "deb https://nginx.org/packages/ubuntu/ jammy nginx\ndeb-src https://nginx.org/packages/ubuntu/ jammy nginx" | tee /etc/apt/sources.list.d/nginx.list
RUN apt-get update && apt-get install -y \
git-all \
gnupg2 \
libicu-dev \
libjemalloc-dev \
libpq-dev \
nginx \
nodejs \
openssl \
rustc \
xz-utils \
&& apt-get clean \
&& apt-get autoremove -y
# Create missing directory for git-daemon to work properly with runit
RUN mkdir -p /var/lib/supervise/git-daemon
# Install RVM and Ruby
RUN gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
&& curl -sSL https://get.rvm.io | bash -s stable
RUN rvm install ruby-3.4.2 -C --with-jemalloc \
&& rvm use --default ruby-3.4.2 \
&& rvm cleanup all
# Set the required environment variables
ENV RACK_ENV production
ENV RAILS_ENV production
ENV NODE_ENV production
ENV PATH=${PATH}:/usr/local/rvm/rubies/ruby-3.4.2/bin
ENV PATH=${PATH}:/usr/local/rvm/gems/ruby-3.4.2/bin
ENV GEM_HOME /usr/local/rvm/gems/ruby-3.4.2
ENV GEM_PATH /usr/local/rvm/gems/ruby-3.4.2
ENV LD_PRELOAD=${LD_PRELOAD}:/lib/x86_64-linux-gnu/libjemalloc.so.2
ENV RUBY_YJIT_ENABLE 1
COPY build build
# Install Nginx and Puma
RUN build/nginx/install.sh
RUN build/puma/install.sh
# Cleanup everything
RUN rvm cleanup all \
&& apt-get remove -y autoconf automake \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Use baseimage-docker's init system
CMD ["/sbin/my_init"]
EXPOSE 80