Skip to content

Instantly share code, notes, and snippets.

@louisbl
Last active May 22, 2020 10:42
Show Gist options
  • Save louisbl/070ae6abd47f4c16258e0062339e2198 to your computer and use it in GitHub Desktop.
Save louisbl/070ae6abd47f4c16258e0062339e2198 to your computer and use it in GitHub Desktop.
docker-compose with db persistence
data:
image: debian:jessie
user: www-data
volumes:
- ./src:/var/www/
web:
image: php:5.6-apache
links:
- db
ports:
- "8888:80"
volumes:
- ./conf/php.ini:/usr/local/etc/php/conf.d/custom.ini
volumes_from:
- data
db:
image: mariadb:5.5
volumes:
- ./data/dump:/docker-entrypoint-initdb.d
- ./data/db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mysqldb
MYSQL_USER: mysqldb_user
MYSQL_PASSWORD: mysqldb_password
.
├── conf
│   ├── php.ini
├── data
│   ├── dump
│   │   ├── dump.sql
│   ├── db
│   │   ├── ...
├── docker-compose.yml
├── src
│   ├── html
│   │   ├── index.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment