-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathDockerfile
102 lines (86 loc) · 3.15 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
FROM --platform=linux/amd64 ruby:3.0.3-slim-buster
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update > /dev/null && apt-get install -y --no-install-recommends > /dev/null \
build-essential=* \
imagemagick=* \
curl \
wget \
gnupg2 \
git \
apt-utils \
&& apt-get dist-upgrade -yf\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
RUN sed -i -e 's/# et_EE.UTF-8 UTF-8/et_EE.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=et_EE.UTF-8
ENV LANG et_EE.UTF-8
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc -s | apt-key add -
RUN sh -c 'echo "deb https://apt-archive.postgresql.org/pub/repos/apt bionic-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
RUN apt-get update > /dev/null && apt-get install -y --no-install-recommends > /dev/null \
postgresql-client-13=* \
libpq-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# add repository for Node.js in the LTS version
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y --no-install-recommends > /dev/null \
nodejs=* \
qt5-default=* \
libqt5webkit5-dev=* \
gstreamer1.0-plugins-base=* \
libappindicator3-1=* \
gstreamer1.0-tools=* \
qtdeclarative5-dev=* \
fonts-liberation=* \
gstreamer1.0-x=* \
libasound2=* \
libnspr4=* \
libnss3=* \
libxss1=* \
libxtst6=* \
xdg-utils=* \
qtdeclarative5-dev=* \
fonts-liberation=* \
gstreamer1.0-x=* \
wkhtmltopdf \
libxslt1-dev \
libxml2-dev \
python-dev \
unzip \
# libc6-i386 \
# lib32gcc-s1 \
wkhtmltopdf \
xvfb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get autoremove -y && apt-get clean
ENV CHROME_VERSION="128.0.6613.137"
RUN wget -q "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chrome-linux64.zip" \
&& unzip chrome-linux64.zip -d /opt/ \
&& rm chrome-linux64.zip
RUN wget -q "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chromedriver-linux64.zip" \
&& unzip chromedriver-linux64.zip -d /opt/ \
&& mv /opt/chromedriver-linux64/chromedriver /usr/local/bin/ \
&& rm -rf chromedriver-linux64.zip /opt/chromedriver-linux64
RUN npm install --global yarn
RUN mkdir -p /opt/webapps/app/tmp/pids
WORKDIR /opt/webapps/app
COPY Gemfile Gemfile.lock ./
# ADD vendor/gems/omniauth-tara ./vendor/gems/omniauth-tara
RUN gem install bundler && bundle install --jobs 20 --retry 5
ENV PATH="/opt/chrome-linux64:${PATH}"
# RUN apt-get update && apt-get install -y --no-install-recommends > /dev/null \
# libc6-i386 \
# lib32gcc-s1 \
# wkhtmltopdf \
# xvfb \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
RUN ln -s /lib/ld-linux.so.2 /lib/ld-linux.so.2 || true
# Обертка для wkhtmltopdf с xvfb
RUN echo '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf "$@"' > /usr/local/bin/wkhtmltopdf \
&& chmod +x /usr/local/bin/wkhtmltopdf
EXPOSE 3000