Skip to content

Commit

Permalink
all stuff docker (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiserWerk committed Jan 18, 2022
1 parent e8d60b5 commit 1ce0a95
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 21 deletions.
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ FROM php:7.4-apache

RUN apt-get update
RUN apt-get install -y git
#RUN docker-php-ext-install mysqli
#RUN docker-php-ext-install json
#RUN docker-php-ext-install zip
#RUN docker-php-ext-install xml
#RUN docker-php-ext-install curl
#RUN docker-php-ext-install pdo
#RUN docker-php-ext-install pdo_mysql
#RUN docker-php-ext-install session
RUN docker-php-ext-install pdo_mysql

RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Expand All @@ -21,6 +14,7 @@ COPY ./vhost.conf /etc/apache2/sites-available/000-default.conf
WORKDIR /var/www/html

RUN mkdir -p /var/www/html/var/sessions
RUN mkdir -p /var/www/html/var/logs

RUN chown -R www-data:www-data /var/www/html
RUN a2enmod rewrite
Expand Down
4 changes: 2 additions & 2 deletions app/Helper/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public static function getMessage()
}
}

public static function createZip($files = array(), $destination = '', $overwrite = false) {
public static function createZip($files = array(), $destination = '', $overwrite = false)
{
if (file_exists($destination) && !$overwrite) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if ($climate->arguments->defined('help')) {
* Correct database settings are required.
*/
if ($climate->arguments->defined('create-schema')) {
$sqlFile = 'etc/schema.sql';
$sqlFile = 'etc/01-schema.sql';
if (!file_exists($sqlFile)) {
$climate->red()->out('Schema file does not exist or could not be found!');
}
Expand Down
4 changes: 2 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# site config
site:
env: dev # dev/prod
env: prod # dev/prod
name: WPCustomRepository
operator: 1
default_locale: en
Expand All @@ -20,7 +20,7 @@ cookie:
database:
driver: mysql # or sqlite (file needs to be set)
host: db
port: 3316
port: 3306
username: dbo
password: test123
dbname: wpcr
Expand Down
22 changes: 16 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
version: "2"
version: "3.9"

services:
php:
build: .
container_name: wpcr_app
container_name: wpcr_php
volumes:
- ./:/var/www/html
- /var/log/apache2/wpcr:/var/log/apache2
- vardata:/var/www/html/var
ports:
- "8000:80"
- "9727:80"
depends_on:
- db
networks:
wpcr_net:

db:
image: mysql:5.7
Expand All @@ -20,7 +23,14 @@ services:
MYSQL_DATABASE: wpcr
MYSQL_USER: dbo
MYSQL_PASSWORD: test123
ports:
- "3316:3306"
volumes:
- "./etc/schema.sql:/docker-entrypoint-initdb.d/1.sql"
- "./etc/sql:/docker-entrypoint-initdb.d"
networks:
wpcr_net:

networks:
wpcr_net:
driver: bridge

volumes:
vardata:
2 changes: 0 additions & 2 deletions etc/schema.sql → etc/sql/01-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

INSERT INTO `user` (`id`, `username`, `first_name`, `last_name`, `password`, `email`, `confirmation_token`, `confirmation_token_validity`, `last_login`, `locale`, `admin`, `locked`, `created_at`) VALUES
(1, 'test', 'John', 'Doe', '$2y$12$QH3n2eXBzdLB1kqdiXGbrO9m23HlxlzDj0vgW7zRMvOatRR7jdS7u', 'test@test.test', NULL, NULL, NULL, 'en', 1, 0, '2022-01-18 00:55:39');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
Expand Down
4 changes: 4 additions & 0 deletions etc/sql/02-data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
USE wpcr;

INSERT INTO `user` (`id`, `username`, `first_name`, `last_name`, `password`, `email`, `confirmation_token`, `confirmation_token_validity`, `last_login`, `locale`, `admin`, `locked`, `created_at`) VALUES
(1, 'test', 'John', 'Doe', '$2y$12$QH3n2eXBzdLB1kqdiXGbrO9m23HlxlzDj0vgW7zRMvOatRR7jdS7u', 'test@test.test', NULL, NULL, NULL, 'en', 1, 0, '2022-01-18 00:55:39');

0 comments on commit 1ce0a95

Please sign in to comment.