-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
140 lines (123 loc) · 4.18 KB
/
Dockerfile
File metadata and controls
140 lines (123 loc) · 4.18 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
FROM debian:bookworm
ARG NODE_VERSION
ARG PHP_VERSION
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git zip unzip wget \
&& rm -rf /var/lib/apt/lists/*
# Add repositories
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
gnupg \
software-properties-common \
gettext-base \
&& rm -rf /var/lib/apt/lists/* \
&& curl -sSL http://debian.hypernode.com/repo.key | apt-key add - \
&& echo "deb http://debian.hypernode.com bookworm main hypernode" | tee /etc/apt/sources.list.d/hypernode.list \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& echo "deb http://deb.nodesource.com/node_${NODE_VERSION}.x bookworm main" | tee /etc/apt/sources.list.d/nodesource.list \
&& echo \
"Package: * \
Pin origin deb.nodesource.com \
Pin-Priority: 1001" > /etc/apt/preferences.d/nodejs
# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
openssh-client \
rsync \
git \
patch \
bash \
jq \
ca-certificates \
python3 \
virtualenv \
wget \
curl \
openssl \
g++ \
autoconf \
make \
libtool \
nodejs \
gnupg \
zip \
bc \
&& apt install -y --no-install-recommends \
php${PHP_VERSION} \
php${PHP_VERSION}-amqp \
php${PHP_VERSION}-bcmath \
php${PHP_VERSION}-bz2 \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-common \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-igbinary \
php${PHP_VERSION}-imagick \
php${PHP_VERSION}-imap \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-ldap \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-odbc \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-pspell \
php${PHP_VERSION}-readline \
php${PHP_VERSION}-redis \
php${PHP_VERSION}-soap \
php${PHP_VERSION}-tidy \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-zip \
&& rm -rf /var/lib/apt/lists/*
COPY ./.git /hypernode/.git
COPY ./bin /hypernode/bin
COPY ./ci /hypernode/ci
COPY ./src /hypernode/src
COPY ./box.json /hypernode/box.json
COPY ./composer.json /hypernode/composer.json
COPY ./ci/build/files /
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer \
&& composer install --no-dev --optimize-autoloader --working-dir=/hypernode
RUN bash /hypernode/ci/compile.sh
# Setup hipex deploy command
RUN cp /hypernode/build/hypernode-deploy.phar /bin/hypernode-deploy
RUN chmod +x /bin/hypernode-deploy
RUN ln -s /bin/hypernode-deploy /bin/hipex-deploy
# Install composer 1
RUN curl -sS https://getcomposer.org/installer | php -- --1 --filename=composer1 && mv composer1 /usr/local/bin/ && chmod +x /usr/local/bin/composer1
# Install composer 2
RUN curl -sS https://getcomposer.org/installer | php -- --2.2 --filename=composer2 && mv composer2 /usr/local/bin/ && chmod +x /usr/local/bin/composer2
# Use version 1 for main composer binary
RUN rm -f /usr/local/bin/composer; ln -s /usr/local/bin/composer2 /usr/local/bin/composer
# Set python3 as default python executable
RUN ln -s /usr/bin/python3 /usr/local/bin/python
# Copy container files
COPY ./ci/build/files /
# Setup SSH configuration
RUN mkdir -p /root/.ssh \
&& chmod -vf 700 /root/.ssh \
&& (chmod -vf 600 /root/.ssh/* || true) \
&& chmod -vf 700 /etc/ssh \
&& chmod -vf 600 /etc/ssh/*
# Cleanup
RUN rm -rvf \
/tmp/* \
/usr/share/man \
/var/lib/apt/lists/* \
&& apt-get autoremove -y
# Allow hypernode-deploy to be ran in ordinary git repository locations
RUN git config --global --add safe.directory "*"
# Setup default command
CMD ["hypernode-deploy"]
# Setup build location
RUN mkdir /build
VOLUME /build
WORKDIR /build