Skip to content

Commit 1ce0a95

Browse files
committed
all stuff docker (#4)
1 parent e8d60b5 commit 1ce0a95

File tree

7 files changed

+27
-21
lines changed

7 files changed

+27
-21
lines changed

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@ FROM php:7.4-apache
22

33
RUN apt-get update
44
RUN apt-get install -y git
5-
#RUN docker-php-ext-install mysqli
6-
#RUN docker-php-ext-install json
7-
#RUN docker-php-ext-install zip
8-
#RUN docker-php-ext-install xml
9-
#RUN docker-php-ext-install curl
10-
#RUN docker-php-ext-install pdo
11-
#RUN docker-php-ext-install pdo_mysql
12-
#RUN docker-php-ext-install session
5+
RUN docker-php-ext-install pdo_mysql
136

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

2316
RUN mkdir -p /var/www/html/var/sessions
17+
RUN mkdir -p /var/www/html/var/logs
2418

2519
RUN chown -R www-data:www-data /var/www/html
2620
RUN a2enmod rewrite

app/Helper/Helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public static function getMessage()
4949
}
5050
}
5151

52-
public static function createZip($files = array(), $destination = '', $overwrite = false) {
53-
52+
public static function createZip($files = array(), $destination = '', $overwrite = false)
53+
{
5454
if (file_exists($destination) && !$overwrite) {
5555
return false;
5656
}

bin/console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if ($climate->arguments->defined('help')) {
7070
* Correct database settings are required.
7171
*/
7272
if ($climate->arguments->defined('create-schema')) {
73-
$sqlFile = 'etc/schema.sql';
73+
$sqlFile = 'etc/01-schema.sql';
7474
if (!file_exists($sqlFile)) {
7575
$climate->red()->out('Schema file does not exist or could not be found!');
7676
}

config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# site config
22
site:
3-
env: dev # dev/prod
3+
env: prod # dev/prod
44
name: WPCustomRepository
55
operator: 1
66
default_locale: en
@@ -20,7 +20,7 @@ cookie:
2020
database:
2121
driver: mysql # or sqlite (file needs to be set)
2222
host: db
23-
port: 3316
23+
port: 3306
2424
username: dbo
2525
password: test123
2626
dbname: wpcr

docker-compose.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
version: "2"
1+
version: "3.9"
22

33
services:
44
php:
55
build: .
6-
container_name: wpcr_app
6+
container_name: wpcr_php
77
volumes:
88
- ./:/var/www/html
99
- /var/log/apache2/wpcr:/var/log/apache2
10+
- vardata:/var/www/html/var
1011
ports:
11-
- "8000:80"
12+
- "9727:80"
1213
depends_on:
1314
- db
15+
networks:
16+
wpcr_net:
1417

1518
db:
1619
image: mysql:5.7
@@ -20,7 +23,14 @@ services:
2023
MYSQL_DATABASE: wpcr
2124
MYSQL_USER: dbo
2225
MYSQL_PASSWORD: test123
23-
ports:
24-
- "3316:3306"
2526
volumes:
26-
- "./etc/schema.sql:/docker-entrypoint-initdb.d/1.sql"
27+
- "./etc/sql:/docker-entrypoint-initdb.d"
28+
networks:
29+
wpcr_net:
30+
31+
networks:
32+
wpcr_net:
33+
driver: bridge
34+
35+
volumes:
36+
vardata:

etc/schema.sql renamed to etc/sql/01-schema.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,6 @@ ALTER TABLE `user`
334334
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
335335
COMMIT;
336336

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

340338
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
341339
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

etc/sql/02-data.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
USE wpcr;
2+
3+
INSERT INTO `user` (`id`, `username`, `first_name`, `last_name`, `password`, `email`, `confirmation_token`, `confirmation_token_validity`, `last_login`, `locale`, `admin`, `locked`, `created_at`) VALUES
4+
(1, 'test', 'John', 'Doe', '$2y$12$QH3n2eXBzdLB1kqdiXGbrO9m23HlxlzDj0vgW7zRMvOatRR7jdS7u', 'test@test.test', NULL, NULL, NULL, 'en', 1, 0, '2022-01-18 00:55:39');

0 commit comments

Comments
 (0)