add docker-compose

develop
Clement FERRERE 3 years ago
parent f12ea87744
commit 0bc92f87c3
  1. 25
      .dockerignore
  2. 6
      .env
  3. 4
      .gitignore
  4. 55
      db/init_db.sql
  5. 11
      docker-compose.override.yml
  6. 46
      docker-compose.yml

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

@ -0,0 +1,6 @@
DATABASE_HOSTNAME=localhost
DATABASE_PORT=3306
DATABASE_NAME=collaborateur_epa
APP_DB_USERNAME=root
APP_DB_PASSWORD=root
APP_DB_ROOT_PASSWORD=root

4
.gitignore vendored

@ -302,9 +302,6 @@ node_modules/
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
@ -401,6 +398,7 @@ FodyWeavers.xsd
# ---> JetBrains
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea
# User-specific stuff
.idea/**/workspace.xml

@ -0,0 +1,55 @@
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
DROP DATABASE IF EXISTS collaborateur_epa;
CREATE DATABASE IF NOT EXISTS collaborateur_epa /*!40100 DEFAULT CHARACTER SET latin1 */;
USE collaborateur_epa;
DROP TABLE IF EXISTS agence;
CREATE TABLE IF NOT EXISTS agence(
Id int NOT NULL AUTO_INCREMENT,
Name varchar(100) NOT NULL UNIQUE,
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS businessunit;
CREATE TABLE IF NOT EXISTS businessunit(
Id int NOT NULL AUTO_INCREMENT,
Name varchar(100) NOT NULL UNIQUE,
agenceId int NOT NULL,
CONSTRAINT FK_BUSINESS_UNIT_AGENCE FOREIGN KEY (agenceId) references agence(Id),
PRIMARY KEY (Id)
);
DROP TABLE IF EXISTS collaborateur;
CREATE TABLE IF NOT EXISTS collaborateur(
Id int NOT NULL AUTO_INCREMENT,
Name varchar(100) NOT NULL,
FirstName varchar(100) NOT NULL,
BirthDate date NOT NULL,
Gender ENUM('masculin','feminin','autre') NOT NULL DEFAULT 'masculin',
Status ENUM('cadre','noncadre','alternant','stagiaire') NOT NULL DEFAULT 'noncadre',
ChildrenNumber smallint NOT NULL,
Address varchar(200) NOT NULL,
Telephone varchar(15) NOT NULL,
PersonalMail varchar(100) NOT NULL,
ApsideMail varchar(100) NOT NULL,
ResignationDate date,
businessunitId int NOT NUll,
ReferrerId int,
CONSTRAINT FK_COLLABORATEUR_BUSINESSUNIT FOREIGN KEY (businessunitId) REFERENCES businessunit(Id),
CONSTRAINT FK_COLLABORATEUR_PARRAIN FOREIGN KEY (ReferrerId) REFERENCES collaborateur(Id),
PRIMARY KEY (Id)
);
INSERT INTO agence(Id, Name) VALUES (1,'Clermont-Ferrand');
INSERT INTO businessunit(Id, Name, agenceId) VALUES (1,'Cournon',1);
INSERT INTO collaborateur(Name, FirstName, BirthDate, Gender, Status, ChildrenNumber, Address, Telephone, PersonalMail,
ApsideMail, ResignationDate, businessunitId, ReferrerId)
VALUES ('Dupont','Marie','1990-08-08','feminin','cadre',0,'adresse','tel','pmail','amail','2030-08-08',1,1);
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

@ -0,0 +1,11 @@
version: '3.4'
services:
api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=https://+:443;http://+:80
- ASPNETCORE_Kestrel__Certificates__Default__Password=password
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx
volumes:
- ~/.aspnet/https:/https:ro

@ -0,0 +1,46 @@
version: '3.4'
volumes:
data-volume: {}
services:
db:
image: "mariadb:10.7.1"
restart: always
environment:
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_USERNAME=${APP_DB_USERNAME}
- MYSQL_PASSWORD=${APP_DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${APP_DB_ROOT_PASSWORD}
volumes:
- data-volume:/var/lib/mysql
- ./db/init_db.sql:/docker-entrypoint-initdb.d/init.sql
api:
image: ${DOCKER_REGISTRY-}espacecollabbackendapi
build:
context: ./../Collaborateur-Epa-Back/Collaborateur_Epa_Back
dockerfile: espacecollab.backend.api/Dockerfile
ports:
- "5000:80"
- "5001:443"
links:
- db
environment:
- DATABASE_HOSTNAME=db
- DATABASE_PORT=3306
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_USERNAME=${APP_DB_USERNAME}
- DATABASE_PASSWORD=${APP_DB_PASSWORD}
front:
image: ${DOCKER_REGISTRY-}collab-front
build:
context: ./../Collaborateur-Epa-Front
dockerfile: ./Dockerfile
ports:
- "8083:80"
links:
- api
Loading…
Cancel
Save