We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Real world app always have a database.
The text was updated successfully, but these errors were encountered:
As you copy the docker-compose.yml to your project you can add your database of choice there. For mysql e.g.:
docker-compose.yml
mysql
version: '3.4' services: # ... db: image: mysql:5.7 # or percona or mariadb ports: - "3306:3306" volumes: - mysql_data:/var/lib/mysql:rw environment: MYSQL_DATABASE: "db" MYSQL_USER: "user" MYSQL_PASSWORD: "password" MYSQL_ALLOW_EMPTY_PASSWORD: "yes" volumes: mysql_data: driver: local
and add DATABASE_URL: "mysql://user:password@db:3306/db" to your env vars (see https://github.com/sherifabdlnaby/symdocker/blob/master/docker/.compose/docker-compose.yml#L14).
DATABASE_URL: "mysql://user:password@db:3306/db"
For postgres you can use something like:
postgres
version: '3.4' services: # ... db: image: postgres:12 ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data:rw environment: POSTGRES_USER: "user" POSTGRES_PASSWORD: "password" POSTGRES_DB: "db" volumes: pgdata: driver: local
and use "postgres://user:password@db:5432/db" as the DATABASE_URL.
"postgres://user:password@db:5432/db"
DATABASE_URL
Sorry, something went wrong.
thanks
No branches or pull requests
Real world app always have a database.
The text was updated successfully, but these errors were encountered: