Skip to content

Commit

Permalink
Updated doctrine dbal to 3.x; Added docker compose for local deving (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Schmick authored Sep 8, 2021
1 parent 624f4c7 commit 7d05f82
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 3 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
],
"require": {
"php": ">=7.3",
"doctrine/dbal": "^2.9",
"ext-json": "*",
"doctrine/dbal": "^3.1",
"illuminate/bus": "^8.11",
"illuminate/console": "^8.11",
"illuminate/contracts": "^8.11",
"illuminate/database": "^8.11",
"illuminate/events": "^8.11",
"illuminate/notifications": "^8.11",
"laravelcollective/html": "^6.0",
"ext-json": "*"
"laravelcollective/html": "^6.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
Expand Down
32 changes: 32 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: "3.7"
services:
app:
build:
context: ./
dockerfile: ./docker/Dockerfile
image: totem
container_name: totem-app
restart: unless-stopped
working_dir: /var/www/
volumes:
- ./:/var/www:delegated
networks:
- totem

db:
image: mysql:8.0.20
container_name: totem-db
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- ./docker/mysql:/docker-entrypoint-initdb.d:delegated
networks:
- totem

networks:
totem:
driver: bridge
31 changes: 31 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM php:7.3.29-fpm

# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
zip \
unzip

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip fileinfo sockets

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -d /home/ubuntu ubuntu
RUN mkdir -p /home/ubuntu/.composer && \
chown -R ubuntu:ubuntu /home/ubuntu

# Set working directory
WORKDIR /var/www

USER ubuntu
2 changes: 2 additions & 0 deletions docker/mysql/init_db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE USER admin@'%' IDENTIFIED WITH mysql_native_password BY 'dev';
GRANT ALL PRIVILEGES ON *.* TO admin@'%';

0 comments on commit 7d05f82

Please sign in to comment.