Difference between revisions of "Docker"

From Bebot Wiki 2
Jump to navigationJump to search
Line 9: Line 9:
 
Mac => https://docs.docker.com/desktop/install/mac-install/
 
Mac => https://docs.docker.com/desktop/install/mac-install/
  
===== =====
+
===== Build =====
...
+
 
 +
Once the software is installed, you'll have to build a container based on Bebot itself + docker elements.
 +
 
 +
So you can download Bebot code (either from Official/Stable or Sandbox/Dev) as .zip (or using git pull command).
 +
 
 +
Once done you'll have a Bebot folder in which you will create 2 text files :
 +
 
 +
(no extension)
 +
Dockerfile
 +
<pre>
 +
FROM alpine:latest
 +
ENTRYPOINT ["/sbin/tini", "-g", "--"]
 +
CMD ["/bebot/docker-entrypoint.sh"]
 +
RUN apk --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ add \
 +
    php82-cli php82-sqlite3 php82-phar php82-curl php82-sockets php82-pdo php82-pdo_sqlite \
 +
    php82-pdo_mysql php82-mbstring php82-ctype php82-bcmath php82-json php82-posix php82-simplexml \
 +
php82-dom php82-pcntl php82-zip php82-opcache php82-fileinfo php82-mysqli \
 +
tini \
 +
    sudo \
 +
    && \
 +
    adduser -h /bebot -s /bin/false -D -H bebot
 +
COPY --chown=bebot:bebot . /bebot
 +
RUN sudo ln -s /usr/bin/php82 /usr/bin/php8
 +
USER bebot
 +
WORKDIR /bebot
 +
</pre>
  
 
===== test2 =====
 
===== test2 =====
 
...
 
...

Revision as of 21:02, 5 December 2023

Docker

So using Docker can save you some installation hassle, but you'll need to have it installed properly - depending on system hosting your bot(s) :

Windows => https://docs.docker.com/desktop/install/windows-install/

Linux => https://docs.docker.com/desktop/install/linux-install/

Mac => https://docs.docker.com/desktop/install/mac-install/

Build

Once the software is installed, you'll have to build a container based on Bebot itself + docker elements.

So you can download Bebot code (either from Official/Stable or Sandbox/Dev) as .zip (or using git pull command).

Once done you'll have a Bebot folder in which you will create 2 text files :

(no extension) Dockerfile

FROM alpine:latest
ENTRYPOINT ["/sbin/tini", "-g", "--"]
CMD ["/bebot/docker-entrypoint.sh"]
RUN apk --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ add \
    php82-cli php82-sqlite3 php82-phar php82-curl php82-sockets php82-pdo php82-pdo_sqlite \
    php82-pdo_mysql php82-mbstring php82-ctype php82-bcmath php82-json php82-posix php82-simplexml \
	php82-dom php82-pcntl php82-zip php82-opcache php82-fileinfo php82-mysqli \
	tini \
    sudo \
    && \
    adduser -h /bebot -s /bin/false -D -H bebot
COPY --chown=bebot:bebot . /bebot
RUN sudo ln -s /usr/bin/php82 /usr/bin/php8
USER bebot
WORKDIR /bebot
test2

...