-
Notifications
You must be signed in to change notification settings - Fork 284
/
Copy pathDockerfile.tcie
76 lines (60 loc) · 2.33 KB
/
Dockerfile.tcie
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
FROM ruby:3.2.2 as build
LABEL maintainer Travis CI GmbH <support+travis-web-docker-images@travis-ci.com>
ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 18.19.0
ENV YARN_VERSION 0.22.0
ARG AIDA_URL
RUN ( \
groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node; \
curl --version;)
RUN ( \
curl -SLOv "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs; )
RUN ( \
curl -fSL -o yarn.js "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-legacy-$YARN_VERSION.js" \
&& mv yarn.js /usr/local/bin/yarn \
&& chmod +x /usr/local/bin/yarn; \
mkdir -p /app; \
)
COPY package.json /app
COPY package-lock.json /app
COPY . /app
WORKDIR /app
RUN --mount=type=secret,id=GITHUB_PERSONAL_TOKEN export GITHUB_PERSONAL_TOKEN=$(cat /run/secrets/GITHUB_PERSONAL_TOKEN) && git config --global url."https://$GITHUB_PERSONAL_TOKEN@github.com/".insteadOf ssh://git@github.com
RUN (\
npm install --silent -g ember-cli; \
npm ci; \
if test $AIDA_URL; then \
curl -o /app/node_modules/asktravis/dist/aida.js $AIDA_URL; \
curl -o /app/node_modules/asktravis/dist/aida.js.map $AIDA_URL.map || true; \
fi; \
ember build --environment=production; \
)
FROM ruby:3.2.2-slim
LABEL maintainer Travis CI GmbH <support+travis-web-docker-images@travis-ci.com>
RUN ( \
gem install bundler:2.3.7; \
bundle config --global frozen 1; \
mkdir -p /app/dist; \
)
WORKDIR /app
COPY --from=build /app/dist/ /app/dist/
COPY --from=build /app/maintenance/ /app/maintenance/
COPY Gemfile* /app/
COPY waiter /app/waiter
COPY public /app/public
COPY ssl /app/ssl
RUN (\
cp -a public/* dist/; \
rm -rf public; \
apt-get update ; \
apt-get upgrade -y ; \
apt-get install -y --no-install-recommends git make gcc g++ libpq-dev libjemalloc-dev xz-utils; \
rm -rf /var/lib/apt/lists/*; \
bundle install --without assets development test; \
sed -i "/stripe.com\/v3/d" /app/dist/index.html; \
apt-get remove -y gcc g++ make git perl xz-utils && apt-get -y autoremove; \
)
CMD ["bundle", "exec", "puma", "-I", "lib", "-p", "${PORT:-4000}", "-t", "${PUMA_MIN_THREADS:-8}:${PUMA_MAX_THREADS:-12}", "-w", "${PUMA_WORKERS:-2}", "--preload", "waiter/config.ru" ]