fix ENV variables, apply ENV in frontend config
This commit is contained in:
@@ -6,14 +6,14 @@ const API_VERSION = 'v2';
|
|||||||
|
|
||||||
const API_SERVER_BASE = (() => {
|
const API_SERVER_BASE = (() => {
|
||||||
if(APPLICAITON_MODE === 'TEST'){
|
if(APPLICAITON_MODE === 'TEST'){
|
||||||
return process.env.TEST_URL;
|
return process.env.REACT_APP_TEST_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(APPLICAITON_MODE === 'PROD'){
|
if(APPLICAITON_MODE === 'PROD'){
|
||||||
return process.env.PROD_URL;
|
return process.env.REACT_APP_PROD_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'http://localhost:8000';
|
return process.env.REACT_APP_DEV_URL;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const API_SERVER = API_SERVER_BASE + '/' + API_VERSION;
|
const API_SERVER = API_SERVER_BASE + '/' + API_VERSION;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
FROM php:7.0-apache
|
FROM php:7.0-apache
|
||||||
|
|
||||||
ENV TEST_URL=http://localhost:8000/api-wiaas \
|
ENV REACT_APP_TEST_URL=http://localhost:8000/api-wiaas \
|
||||||
PROD_URL=http://localhost:8000/api-wiaas \
|
REACT_APP_PROD_URL=http://localhost:8000/api-wiaas \
|
||||||
DEV_URL=http://localhost:8000/api-wiaas
|
REACT_APP_DEV_URL=http://localhost:8000/api-wiaas
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y git && apt-get install -y unzip
|
RUN apt-get update && apt-get install -y git unzip gnupg
|
||||||
|
|
||||||
COPY docker/php/apache2.conf /etc/apache2/
|
COPY docker/php/apache2.conf /etc/apache2/
|
||||||
COPY docker/php/composer.phar /usr/local/bin/composer
|
COPY docker/php/composer.phar /usr/local/bin/composer
|
||||||
@@ -20,16 +20,12 @@ RUN composer install
|
|||||||
WORKDIR /home/wiaas
|
WORKDIR /home/wiaas
|
||||||
RUN cp -r api-wiaas /var/www/html/
|
RUN cp -r api-wiaas /var/www/html/
|
||||||
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get upgrade -y
|
|
||||||
|
|
||||||
RUN apt-get install -y gnupg
|
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
||||||
RUN apt-get install -y nodejs
|
RUN apt-get install -y nodejs
|
||||||
|
|
||||||
WORKDIR /home/wiaas/client-wiaas
|
WORKDIR /home/wiaas/client-wiaas
|
||||||
RUN npm rebuild node-sass --force
|
RUN npm rebuild node-sass --force
|
||||||
RUN npm install && npm run build
|
RUN npm install && npm run build
|
||||||
RUN cp -r build/* /var/www/html/
|
RUN cp -r build/* /var/www/html/
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo pdo_mysql mysqli
|
RUN docker-php-ext-install pdo pdo_mysql mysqli
|
||||||
|
|||||||
Reference in New Issue
Block a user