Skip to content

Commit 7d05f82

Browse files
author
Quentin Schmick
authored
Updated doctrine dbal to 3.x; Added docker compose for local deving (#296)
1 parent 624f4c7 commit 7d05f82

File tree

4 files changed

+68
-3
lines changed

4 files changed

+68
-3
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
],
1818
"require": {
1919
"php": ">=7.3",
20-
"doctrine/dbal": "^2.9",
20+
"ext-json": "*",
21+
"doctrine/dbal": "^3.1",
2122
"illuminate/bus": "^8.11",
2223
"illuminate/console": "^8.11",
2324
"illuminate/contracts": "^8.11",
2425
"illuminate/database": "^8.11",
2526
"illuminate/events": "^8.11",
2627
"illuminate/notifications": "^8.11",
27-
"laravelcollective/html": "^6.0",
28-
"ext-json": "*"
28+
"laravelcollective/html": "^6.0"
2929
},
3030
"require-dev": {
3131
"mockery/mockery": "^1.0",

docker-compose.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: "3.7"
2+
services:
3+
app:
4+
build:
5+
context: ./
6+
dockerfile: ./docker/Dockerfile
7+
image: totem
8+
container_name: totem-app
9+
restart: unless-stopped
10+
working_dir: /var/www/
11+
volumes:
12+
- ./:/var/www:delegated
13+
networks:
14+
- totem
15+
16+
db:
17+
image: mysql:8.0.20
18+
container_name: totem-db
19+
restart: unless-stopped
20+
environment:
21+
MYSQL_DATABASE: ${DB_DATABASE}
22+
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
23+
SERVICE_TAGS: dev
24+
SERVICE_NAME: mysql
25+
volumes:
26+
- ./docker/mysql:/docker-entrypoint-initdb.d:delegated
27+
networks:
28+
- totem
29+
30+
networks:
31+
totem:
32+
driver: bridge

docker/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM php:7.3.29-fpm
2+
3+
# Install system dependencies
4+
RUN apt-get update && apt-get install -y \
5+
git \
6+
curl \
7+
libpng-dev \
8+
libonig-dev \
9+
libxml2-dev \
10+
libzip-dev \
11+
zip \
12+
unzip
13+
14+
# Clear cache
15+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
16+
17+
# Install PHP extensions
18+
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip fileinfo sockets
19+
20+
# Get latest Composer
21+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
22+
23+
# Create system user to run Composer and Artisan Commands
24+
RUN useradd -G www-data,root -d /home/ubuntu ubuntu
25+
RUN mkdir -p /home/ubuntu/.composer && \
26+
chown -R ubuntu:ubuntu /home/ubuntu
27+
28+
# Set working directory
29+
WORKDIR /var/www
30+
31+
USER ubuntu

docker/mysql/init_db.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE USER admin@'%' IDENTIFIED WITH mysql_native_password BY 'dev';
2+
GRANT ALL PRIVILEGES ON *.* TO admin@'%';

0 commit comments

Comments
 (0)