Skip to content

Instantly share code, notes, and snippets.

@bastienapp
Last active July 26, 2023 12:37
Show Gist options
  • Save bastienapp/9999609352f07da2943ddb5385393dd9 to your computer and use it in GitHub Desktop.
Save bastienapp/9999609352f07da2943ddb5385393dd9 to your computer and use it in GitHub Desktop.
Docker deployment: MySQL
FROM mysql:8
ENV MYSQL_ROOT_PASSWORD your_password_here
ENV TZ 'Europe/Paris'
ENV LANG C.UTF-8
#You can uncomment the next line and create a schema.sql script, launched on startup
#ADD schema.sql /docker-entrypoint-initdb.d
CMD ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--default-authentication-plugin=mysql_native_password"]
VOLUME /var/lib/mysql
EXPOSE 3306
CREATE DATABASE IF NOT EXISTS database_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment