Created
May 31, 2022 20:19
-
-
Save ronoaldo/b3d37fd19fdea52cc9bf25953fae71aa to your computer and use it in GitHub Desktop.
MariaDB com acesso externo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service mariadb start | |
sleep 2 | |
echo "create user external@'%' identified by 'external';" | mysql -u root -p123456 | |
sleep 2 | |
service mariadb stop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:bullseye | |
# Install do server | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN echo "mariadb-server mysql-server/root_password password 123456" | debconf-set-selections | |
RUN echo "mariadb-server mysql-server/root_password_again password 123456" | debconf-set-selections | |
RUN apt-get update && apt-get install mariadb-server -yq | |
# Configuração do acesso externo ao container | |
RUN sed -e 's/bind-address.*/bind-address = 0.0.0.0/g' -i /etc/mysql/mariadb.conf.d/50-server.cnf | |
COPY create-user.sh /tmp/create-user.sh | |
RUN bash /tmp/create-user.sh | |
# Roda o server para testes | |
CMD ["bash", "-c", "service mariadb start && tail -f /var/log/mysql/*.log /var/log/dpkg.log"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment