-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.bot-app
54 lines (36 loc) · 1.24 KB
/
Dockerfile.bot-app
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
FROM debian:trixie-slim AS build
ENV SHELL /bin/bash
RUN apt-get update && \
apt-get install -y \
make git openssl curl unzip coreutils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs
RUN curl -fsSL https://bun.sh/install | bash -s "bun-v1.1.21"
WORKDIR /bot-app
COPY . .
ENV PATH="/root/.bun/bin:${PATH}"
RUN bun install -g rimraf pm2
FROM debian:trixie-slim
ENV SHELL /bin/bash
RUN apt-get update && \
apt-get install -y \
make openssl curl coreutils cron findutils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/sh -u 1001 bot-app
WORKDIR /bot-app
COPY --from=build /root/.bun /root/.bun
COPY --from=build /usr/bin/node /usr/bin/
COPY --from=build /usr/lib/node_modules /usr/lib/node_modules
COPY --from=build /bot-app /bot-app
RUN touch /var/log/cron.log \
&& chown bot-app:bot-app /var/log/cron.log \
&& chmod 644 /var/log/cron.log
COPY --chown=bot-app:bot-app docker/utils/cron.sh /bot-app/docker/utils/cron.sh
RUN chmod 755 /bot-app/docker/utils/cron.sh
ENV PATH="/root/.bun/bin:${PATH}"
EXPOSE 3000
ENTRYPOINT ["/bot-app/docker/utils/cron.sh"]
CMD ["make", "docker-bot-app-entrypoint"]