Update: Test Docker Environments

This commit is contained in:
Yûki VACHOT 2022-01-13 22:05:49 +01:00
parent e3d563d58b
commit 12f71e5a7f
5 changed files with 26 additions and 12 deletions

View file

@ -45,15 +45,15 @@ services:
- flaskaled-srv1
- flaskaled-srv2
environment:
FLASK_APP: app.py
FLASK_ENV: development
FLASK_DEBUG: 1
PYTHONUNBUFFERED: 1
DATABASE_URL_USERS: postgresql://flaskaled1:aled1@flaskaled-srv1/flaskaledDb1
DATABASE_URL_LOGS: postgresql://flaskaled2:aled2@flaskaled-srv2/flaskaledDb2
- FLASK_APP=app.py
- FLASK_ENV=development
- FLASK_DEBUG=1
- PYTHONUNBUFFERED=1
- DATABASE_URL_USERS=postgresql://flaskaled1:aled1@flaskaled-srv1/flaskaledDb1
- DATABASE_URL_LOGS=postgresql://flaskaled2:aled2@flaskaled-srv2/flaskaledDb2
#SECRET_KEY: default_secret_key
#ALLOW_ORIGIN: *
#
#- ALLOW_ORIGIN=frontend
# frontend:
# container_name: frontend
# build: ./frontend
@ -66,4 +66,7 @@ services:
# depends_on:
# - backend
# links:
# - backend
# - backend
# environment:
# - NODE_ENV=development
# - API_URL=http://backend/api

8
frontend/Dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM node:current-alpine
WORKDIR /data/frontend
COPY ["package.json", "package-lock.json*", "./"]
COPY . .
RUN apk add --no-cache gettext
#RUN envsubst < environments/environment.ts > environments/environment.ts
RUN npm install --NODE_ENV
RUN npm install -g @angular/cli

View file

@ -2,6 +2,7 @@ import {Component} from '@angular/core';
import {Router} from "@angular/router";
import {MessageService} from "../../common/services/message/message.service";
import {HashageService} from "../../common/services/hashage/hashage.service";
import {environment} from "../../../environments/environment";
@ -26,6 +27,7 @@ export class PageLoginComponent
// Appuie sur le bouton "seConnecter"
onSeConnecter(): void
{
console.log("test env: "+environment.api_url);
this.checkField();
if(!this.hasError)
{

View file

@ -1,3 +1,4 @@
export const environment = {
production: true
production: true,
api_url: '${API_URL}'
};

View file

@ -1,9 +1,9 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
production: false,
api_url: '${API_URL}'
};
/*