Skip to content

Instantly share code, notes, and snippets.

@exaland
Created December 19, 2022 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exaland/99eebe385fe7f1b7546311ef048a70ef to your computer and use it in GitHub Desktop.
Save exaland/99eebe385fe7f1b7546311ef048a70ef to your computer and use it in GitHub Desktop.
Strapi with MYSQL
version: '3'
services:
strapi:
image: strapi/strapi
container_name: strapi_mysql
environment:
DATABASE_CLIENT: mysql
DATABASE_HOST: mysql
DATABASE_NAME: ${DATABASE_NAME:-strapidb}
DATABASE_PORT: ${DATABASE_PORT:-3306}
DATABASE_USERNAME: ${DATABASE_USERNAME:-strapidb_user}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-P@ssw0rd}
DATABASE_SSL: ${DATABASE_SSL:-false}
volumes:
- ./app:/srv/app
ports:
- '1337:1337'
depends_on:
- mysql
mysql:
image: mysql
command: mysqld --default-authentication-plugin=mysql_native_password
volumes:
- ./data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-r00tP@ssw0rd}
MYSQL_DATABASE: ${MYSQL_DATABASE:-strapidb}
MYSQL_USER: ${MYSQL_USER:-strapidb_user}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-P@ssw0rd}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment