Browse Source

working backend

tags/v1.0.0
Robin Thoni 7 years ago
parent
commit
9b28ed625c
6 changed files with 20 additions and 6 deletions
  1. 14
    2
      backend/Dockerfile
  2. 2
    2
      backend/apache2.conf
  3. 1
    0
      backend/env
  4. 1
    1
      backend/vars-files
  5. 1
    0
      docker-compose.yml
  6. 1
    1
      env

+ 14
- 2
backend/Dockerfile View File

@@ -6,13 +6,20 @@ MAINTAINER Robin Thoni <robin@rthoni.com>
6 6
 ARG CONFIG_DIR=/etc/default/config-files/
7 7
 
8 8
 RUN apt-get update && apt-get -y install\
9
+        curl\
10
+        git\
11
+        unzip\
9 12
         apache2=2.4.*\
10 13
         libapache2-mod-php5\
11 14
         php5\
12 15
         php5-mcrypt\
16
+        php5-imagick\
13 17
         php5-gd &&\
14 18
         apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
15 19
 
20
+RUN curl https://getcomposer.org/composer.phar -o /usr/local/bin/composer \
21
+        && chmod +x /usr/local/bin/composer
22
+
16 23
 RUN /usr/sbin/a2enmod rewrite &&\
17 24
     rm -rf /var/www/html &&\
18 25
     mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html &&\
@@ -28,6 +35,13 @@ COPY apache2.conf /etc/apache2/apache2.conf
28 35
 
29 36
 COPY ./backend/ /var/www/html/
30 37
 
38
+RUN cd /var/www/html && composer install
39
+
40
+COPY env "${CONFIG_DIR}"
41
+
42
+RUN chmod -R 777 /var/www/html/storage/
43
+        #&& ln -s /dev/stdout /var/www/html/storage/logs/lumen.log
44
+
31 45
 COPY ./vars-vars /etc/vars-vars
32 46
 
33 47
 COPY ./vars-files /etc/vars-files
@@ -36,8 +50,6 @@ COPY ./common.sh /common.sh
36 50
 
37 51
 COPY ./run.sh /run.sh
38 52
 
39
-RUN mkdir "${CONFIG_DIR}"
40
-
41 53
 EXPOSE 80
42 54
 
43 55
 CMD ["/run.sh"]

+ 2
- 2
backend/apache2.conf View File

@@ -25,7 +25,7 @@ Listen 80
25 25
     Listen 443
26 26
 </IfModule>
27 27
 
28
-DocumentRoot "/var/www/html/"
28
+DocumentRoot "/var/www/html/public/"
29 29
 
30 30
 <Directory />
31 31
     Options FollowSymLinks
@@ -33,7 +33,7 @@ DocumentRoot "/var/www/html/"
33 33
     Require all denied
34 34
 </Directory>
35 35
 
36
-<Directory /var/www/html/>
36
+<Directory /var/www/html/public/>
37 37
     Options FollowSymLinks
38 38
     AllowOverride All
39 39
     Require all granted

+ 1
- 0
backend/env View File

@@ -0,0 +1 @@
1
+TOKEN=CM_BACKEND_TOKEN

+ 1
- 1
backend/vars-files View File

@@ -1 +1 @@
1
-/var/www/html/env
1
+env /var/www/html/.env

+ 1
- 0
docker-compose.yml View File

@@ -19,6 +19,7 @@ services:
19 19
     backend:
20 20
         build: ./backend
21 21
         container_name: backend-camotion
22
+#        restart: unless-stopped
22 23
         networks:
23 24
             camotion.internal.docker:
24 25
                 aliases:

+ 1
- 1
env View File

@@ -1 +1 @@
1
-CM_BACKEND_TOKEN=change_it
1
+CM_BACKEND_TOKEN=ed249efcda48a07071e2a341fef8759f1bfafeae

Loading…
Cancel
Save