Commit 7ba34b2f79ceba12c403b3e716a68a5bc05ed517

Authored by George Vlahavas
1 parent 611c8fed44

Build our own webserver image

Include the nginx configuration inside the docker container. We're
saving up on one mounted volume like this.

Showing 5 changed files with 28 additions and 26 deletions

api/nginx/conf.d/api.conf View file @ 7ba34b2
1   -server {
2   - listen 80;
3   - index index.php index.html;
4   - error_log /var/log/nginx/error.log;
5   - access_log /var/log/nginx/access.log;
6   - root /var/www/public;
7   -
8   - location ~ \.php$ {
9   - try_files $uri =404;
10   - fastcgi_split_path_info ^(.+\.php)(/.+)$;
11   - fastcgi_pass api:9000;
12   - fastcgi_index index.php;
13   - include fastcgi_params;
14   - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
15   - fastcgi_param PATH_INFO $fastcgi_path_info;
16   - }
17   -
18   - location / {
19   - try_files $uri $uri/ /index.php?$query_string;
20   - gzip_static on;
21   - }
22   -}
docker-compose-jfrog.yml View file @ 7ba34b2
... ... @@ -59,7 +59,7 @@
59 59  
60 60 #Controller
61 61 webserver:
62   - image: registry.curex-project.eu:443/curex-local/kea_webserver:1.19
  62 + image: registry.curex-project.eu:443/curex-local/kea_webserver:1.0.0
63 63 container_name: kea_webserver
64 64 restart: unless-stopped
65 65 depends_on:
... ... @@ -70,7 +70,6 @@
70 70 - "443:443"
71 71 volumes:
72 72 - ./api:/var/www
73   - - ./api/nginx/conf.d/:/etc/nginx/conf.d/
74 73  
75 74 api:
76 75 image: registry.curex-project.eu:443/curex-local/kea_api:1.0.1
docker-compose.yml View file @ 7ba34b2
... ... @@ -65,7 +65,8 @@
65 65  
66 66 #Controller
67 67 webserver:
68   - image: nginx:1.19-alpine
  68 + build:
  69 + context: ./webserver
69 70 container_name: curex-webserver
70 71 restart: unless-stopped
71 72 tty: true
... ... @@ -74,7 +75,6 @@
74 75 - "443:443"
75 76 volumes:
76 77 - ./api:/var/www
77   - - ./api/nginx/conf.d/:/etc/nginx/conf.d/
78 78  
79 79 composer:
80 80 restart: 'no'
webserver/Dockerfile View file @ 7ba34b2
  1 +FROM nginx:1.19-alpine
  2 +COPY api.conf /etc/nginx/conf.d/default.conf
webserver/api.conf View file @ 7ba34b2
  1 +server {
  2 + listen 80;
  3 + index index.php index.html;
  4 + error_log /var/log/nginx/error.log;
  5 + access_log /var/log/nginx/access.log;
  6 + root /var/www/public;
  7 +
  8 + location ~ \.php$ {
  9 + try_files $uri =404;
  10 + fastcgi_split_path_info ^(.+\.php)(/.+)$;
  11 + fastcgi_pass api:9000;
  12 + fastcgi_index index.php;
  13 + include fastcgi_params;
  14 + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  15 + fastcgi_param PATH_INFO $fastcgi_path_info;
  16 + }
  17 +
  18 + location / {
  19 + try_files $uri $uri/ /index.php?$query_string;
  20 + gzip_static on;
  21 + }
  22 +}