Browse Source

Merge fe8c5a7500 into da26affe26

pull/31/merge
Dominik Schwind 1 year ago
committed by GitHub
parent
commit
de1b7c3ed5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 153 additions and 0 deletions
  1. +2
    -0
      .gitignore
  2. +39
    -0
      README.md
  3. +0
    -0
      data/.gitkeep
  4. +36
    -0
      docker-compose.yml
  5. +8
    -0
      docker/apache/000-default.conf
  6. +26
    -0
      docker/apache/Dockerfile
  7. +14
    -0
      docker/build.sh
  8. +14
    -0
      docker/down.sh
  9. +14
    -0
      docker/start.sh

+ 2
- 0
.gitignore View File

@ -1 +1,3 @@
.DS_Store .DS_Store
/data/*
!data/.gitkeep

+ 39
- 0
README.md View File

@ -153,6 +153,45 @@ Timestamps in Exif data do not include the timezone offset, and there is no stan
This will query the database and find the closest matching location for when your clock read that time. This will query the database and find the closest matching location for when your clock read that time.
## Docker for local development (experimental)
This repository comes with a bunch of shell scripts to get a local version of Compass running for development purposes.
`./docker/start.sh` starts an apache webserver, a mysql database and a redis image
`./docker/build.sh` builds the containers without starting them
`./docker/down.sh` shuts down the containers
You will still have to manually install Compass within these containers. When creating the `.env` file, the values are as follows:
```
BASE_URL=http://localhost/
DB_CONNECTION=mysql
DB_HOST=compass_db_1
DB_PORT=3306
DB_DATABASE=compass
DB_USERNAME=user
DB_PASSWORD=user
QUEUE_DRIVER=redis
CACHE_DRIVER=redis
REDIS_HOST=compass_redis_1
```
The command line commands are a bit tricky, too:
`docker exec -ti "compass_webserver_1" sh -c "cd compass && composer install"`
runs the composer install, the `artisan` commands need to be run this way as well. For example the `key:generate` command:
`docker exec -ti "compass_webserver_1" sh -c "cd compass && php artisan key:generate"`
and the `migrate` command:
`docker exec -ti "compass_webserver_1" sh -c "cd compass && php artisan migrate"`
## Credits ## Credits

+ 0
- 0
data/.gitkeep View File


+ 36
- 0
docker-compose.yml View File

@ -0,0 +1,36 @@
version: '3'
services:
webserver:
build: ./docker/apache
restart: unless-stopped
depends_on:
- db
volumes:
- .:/var/www/html:cached
- ./data:/var/compass:cached
ports:
- ${portWebserver}:80
db:
image: mysql:5.7
restart: unless-stopped
volumes:
- db_data:/var/lib/mysql
- ./docker/tmp:/tmp
- ./docker/database:/docker-entrypoint-initdb.d/
ports:
- ${portDatabase}:3306
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ${dbName}
MYSQL_USER: ${dbUser}
MYSQL_PASSWORD: ${dbPassword}
redis:
image: redis:5
restart: unless-stopped
volumes:
- redis_data:/data
volumes:
db_data:
redis_data:

+ 8
- 0
docker/apache/000-default.conf View File

@ -0,0 +1,8 @@
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/var/www/html/compass/public"
<Directory "/var/www/html/compass/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

+ 26
- 0
docker/apache/Dockerfile View File

@ -0,0 +1,26 @@
FROM php:7.1-apache-jessie
RUN apt-get update --fix-missing
RUN apt-get -y install sudo &&\
apt-get -y install curl &&\
apt-get -y install git &&\
apt-get -y install zip unzip &&\
apt-get -y install vim && \
apt-get -y install libicu-dev
RUN docker-php-ext-configure intl
RUN docker-php-ext-install pdo pdo_mysql mysqli intl
RUN curl -sS https://getcomposer.org/installer | php && chmod +x composer.phar && mv composer.phar /usr/local/bin/composer
RUN a2enmod rewrite
RUN echo "ServerName compass" | sudo tee /etc/apache2/conf-available/servername.conf && a2enconf servername
COPY ./000-default.conf /etc/apache2/sites-enabled/000-default.conf
RUN apachectl graceful

+ 14
- 0
docker/build.sh View File

@ -0,0 +1,14 @@
#!/bin/bash
export projectName='compass'
export dbName=${projectName}
export dbUser='user'
export dbPassword='user'
export portWebserver='80'
export portDatabase='3306'
docker-compose -f docker-compose.yml -p ${projectName} build

+ 14
- 0
docker/down.sh View File

@ -0,0 +1,14 @@
#!/bin/bash
export projectName='compass'
export dbName=${projectName}
export dbUser='user'
export dbPassword='user'
export portWebserver='80'
export portDatabase='3306'
docker-compose -f docker-compose.yml -p ${projectName} down

+ 14
- 0
docker/start.sh View File

@ -0,0 +1,14 @@
#!/bin/bash
export projectName='compass'
export dbName=${projectName}
export dbUser='user'
export dbPassword='user'
export portWebserver='80'
export portDatabase='3306'
docker-compose -f docker-compose.yml -p ${projectName} up -d

Loading…
Cancel
Save