docker-compose now uses frontend server

This commit is contained in:
Kacper Donat 2020-11-22 23:07:50 +01:00
parent 17dd5ed296
commit fb6cc37dd8
5 changed files with 17 additions and 10 deletions

View File

@ -2,8 +2,6 @@
# Copy this file to .env file for development, create environment variables when deploying to production # Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
GTM_TAG=
###> symfony/framework-bundle ### ###> symfony/framework-bundle ###
APP_ENV=dev APP_ENV=dev
APP_SECRET=1bdf86cdc78fba654e4f2c309c6bbdbd APP_SECRET=1bdf86cdc78fba654e4f2c309c6bbdbd

View File

@ -2,5 +2,3 @@ twig:
paths: ['%kernel.project_dir%/templates'] paths: ['%kernel.project_dir%/templates']
debug: '%kernel.debug%' debug: '%kernel.debug%'
strict_variables: '%kernel.debug%' strict_variables: '%kernel.debug%'
globals:
gtm_tracking: "%env(GTM_TAG)%"

View File

@ -8,7 +8,7 @@ services:
volumes: volumes:
- ./front:/var/www/front:cached - ./front:/var/www/front:cached
- ./api:/var/www/api:cached - ./api:/var/www/api:cached
- ./docker/nginx/czydojade:/etc/nginx/conf.d/czydojade.conf - ./docker/nginx/cojedzie.conf:/etc/nginx/conf.d/cojedzie.conf
api: api:
build: ./api build: ./api
@ -18,6 +18,15 @@ services:
- ./api:/var/www:cached - ./api:/var/www:cached
- ./docker/php/log.conf:/usr/local/etc/php-fpm.d/zz-log.conf - ./docker/php/log.conf:/usr/local/etc/php-fpm.d/zz-log.conf
frontend:
image: node:15.2.1
working_dir: /app
environment:
- APP_API=http://nginx/api
volumes:
- ./front:/app
command: ["node", "build/server.js"]
blackfire: blackfire:
image: blackfire/blackfire image: blackfire/blackfire
ports: ["8707"] ports: ["8707"]

View File

@ -2,8 +2,6 @@ server {
root /var/www/front/public/; root /var/www/front/public/;
server_name cojedzie.localhost; server_name cojedzie.localhost;
index dist/index.html;
location /api/ { location /api/ {
root /var/www/api/public/; root /var/www/api/public/;
try_files $uri $uri/ index.php$is_args$args; try_files $uri $uri/ index.php$is_args$args;
@ -15,7 +13,12 @@ server {
} }
location / { location / {
try_files $uri $uri/ /dist/index.html =404; try_files $uri $uri/ @frontend;
}
location @frontend {
proxy_pass http://frontend:3000;
proxy_intercept_errors on;
} }
location ~ (.+).php(/|$) { location ~ (.+).php(/|$) {
@ -30,7 +33,6 @@ server {
fastcgi_param APP_ENV "dev"; fastcgi_param APP_ENV "dev";
fastcgi_param DATABASE_URL "sqlite:///%kernel.project_dir%/var/app.db"; fastcgi_param DATABASE_URL "sqlite:///%kernel.project_dir%/var/app.db";
fastcgi_param GTM_TAG "GTM-00000";
internal; internal;
} }

View File

@ -2,7 +2,7 @@
"name": "Co Jedzie?", "name": "Co Jedzie?",
"short_name": "Co Jedzie?", "short_name": "Co Jedzie?",
"orientation": "portrait", "orientation": "portrait",
"lang": "pl_PL", "lang": "pl-PL",
"start_url": "/", "start_url": "/",
"display": "standalone", "display": "standalone",
"background_color": "white", "background_color": "white",