Compare commits

..
15 Commits
Author SHA1 Message Date
marc cd4eb1d8ee good names
Test docker build / back-prod (push) Canceled after 0s
Test docker build / front-prod (push) Canceled after 0s
Test docker build / back-dev (push) Canceled after 0s
Test docker build / front-dev (push) Canceled after 0s
2022-12-12 18:18:36 +01:00
marc af5089f2a0 github action instead of docker-compose 2022-12-12 18:16:17 +01:00
marc f0b2633cfb Merge branch 'master' into infra 2022-12-12 18:10:14 +01:00
marc 65e45f2d56 no .env 2022-12-12 18:06:15 +01:00
marc 29322edd5e test on any pr 2022-12-12 18:03:27 +01:00
marc b03f1cdbe6 Merge branch 'dev-docker-compose' into infra 2022-12-12 18:01:47 +01:00
marc b3f0274d1b test dev
Docker build test / build-back (push) Canceled after 0s
Docker build test / build-front (push) Canceled after 0s
2022-12-12 18:00:31 +01:00
marc 1fbd976753 new names 2022-12-12 17:56:57 +01:00
marc e26d352601 Merge branch 'master' into infra 2022-12-12 17:55:20 +01:00
marc ead6da4832 dev and prod 2022-12-12 17:50:45 +01:00
marc 16864bb251 infra 2022-12-12 17:39:48 +01:00
marc bbaefbb18d Merge branch 'master' into infra 2022-12-12 17:38:34 +01:00
marc 249963ced0 prod.yml + staging.yml 2022-12-12 17:36:52 +01:00
marc 6407ca2880 prod 2022-12-12 17:32:32 +01:00
marc 156eb02ce0 docker-compose.infra.yml 2022-12-12 17:30:39 +01:00
16 changed files with 32 additions and 195 deletions
+3 -6
View File
@@ -31,7 +31,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: front
file: front/Dockerfile.production
dockerfile: Dockerfile
push: true
tags: numerisisep/numeris-front:prod
cache-from: type=gha
@@ -59,7 +59,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: back
file: back/Dockerfile.production
dockerfile: Dockerfile.production
push: true
tags: numerisisep/numeris-back:prod
cache-from: type=gha
@@ -85,7 +85,4 @@ jobs:
cd numeris
git pull
docker-compose -f docker-compose.infra.yml pull
docker-compose -f docker-compose.infra.yml rm -f front back
docker-compose -f docker-compose.infra.yml up -d front back
docker system prune -a
# storage is limited so we clean
docker-compose -f docker-compose.infra.yml up -d --force-recreate
+5 -10
View File
@@ -9,7 +9,7 @@ on:
jobs:
build-front:
name: Build and push front
name: Build front
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -29,16 +29,15 @@ jobs:
- name: Build and push front
uses: docker/build-push-action@v3
with:
build-args: ENVIRONMENT=staging
context: front
file: front/Dockerfile.production
dockerfile: Dockerfile
push: true
tags: numerisisep/numeris-front:staging
cache-from: type=gha
cache-to: type=gha
build-back:
name: Build and push back
name: Build back
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -58,9 +57,8 @@ jobs:
- name: Build and push back
uses: docker/build-push-action@v3
with:
build-args: ENVIRONMENT=staging
context: back
file: back/Dockerfile.production
dockerfile: Dockerfile.production
push: true
tags: numerisisep/numeris-back:staging
cache-from: type=gha
@@ -85,7 +83,4 @@ jobs:
cd numeris
git pull
docker-compose -f docker-compose.infra.yml pull
docker-compose -f docker-compose.infra.yml rm -f front-staging back-staging
docker-compose -f docker-compose.infra.yml up -d front-staging back-staging
docker system prune -a
# storage is limited so we clean
docker-compose -f docker-compose.infra.yml up -d --force-recreate
+1 -2
View File
@@ -1,5 +1,4 @@
.idea/
.vscode/
.env
.env*
var/
var/
+1 -5
View File
@@ -1,10 +1,6 @@
[![Deploy production](https://github.com/numeris-isep/numeris-v2/actions/workflows/prod.yml/badge.svg?branch=master)](https://github.com/numeris-isep/numeris-v2/actions/workflows/prod.yml)
[![Deploy staging](https://github.com/numeris-isep/numeris-v2/actions/workflows/staging.yml/badge.svg?branch=staging)](https://github.com/numeris-isep/numeris-v2/actions/workflows/staging.yml)
[![Test docker build](https://github.com/numeris-isep/numeris-v2/actions/workflows/test.yml/badge.svg)](https://github.com/numeris-isep/numeris-v2/actions/workflows/test.yml)
# Numeris-v2
<!-- [![Build Status](https://travis-ci.com/2Seg/numeris-v2.svg?branch=master)](https://travis-ci.com/2Seg/numeris-v2) -->
[![Build Status](https://travis-ci.com/2Seg/numeris-v2.svg?branch=master)](https://travis-ci.com/2Seg/numeris-v2)
> Created and maintened by [2Seg](https://github.com/2Seg)
-2
View File
@@ -1,5 +1,3 @@
Dockerfile
Dockerfile.production
.DS_Store
vendor
public/storage
+1 -2
View File
@@ -38,5 +38,4 @@ RUN usermod -u 1000 www-data
RUN chown -R www-data:www-data /home/numeris
RUN chown -R www-data:www-data /var/log/apache2/
# ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
ENTRYPOINT ["php", "artisan", "serve", "--host", "0.0.0.0", "--port", "8080"]
ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
+1 -10
View File
@@ -8,18 +8,9 @@
SetEnvIf x-forwarded-proto https HTTPS=on
# Header set Access-Control-Allow-Origin "*"
# Header set Access-Control-Allow-Origin "numeris-isep.fr"
# Header add Access-Control-Allow-Origin "https://numeris-isep.fr"
# Header add Access-Control-Allow-Origin "https://staging.numeris-isep.fr"
# Header always append Access-Control-Allow-Origin: "https://numeris-isep.fr"
# Header always append Access-Control-Allow-Origin: "https://staging.numeris-isep.fr"
# Header always append Access-Control-Allow-Origin: "https://api.numeris-isep.fr"
# Header always append Access-Control-Allow-Origin: "https://api.staging.numeris-isep.fr"
SetEnvIf Origin "http(s)?://(www\.)?(staging\.)?numeris-isep.fr$" AccessControlAllowOrigin=$0
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header set Access-Control-Allow-Credentials true
Header set Access-Control-Allow-Origin "https://numeris-isep.fr"
AllowOverride All
Require all granted
LogLevel debug
</Directory>
ErrorLog /var/log/apache2/error.log
+5 -9
View File
@@ -69,7 +69,6 @@ services:
front:
image: numerisisep/numeris-front:prod
container_name: numeris_front
restart: unless-stopped
networks:
- caddy
labels:
@@ -79,15 +78,15 @@ services:
back-staging:
image: numerisisep/numeris-back:staging
container_name: numeris_back_staging
container_name: numeris_back
restart: unless-stopped
networks:
- caddy
- mysql
env_file:
- .env.staging
- .env
volumes:
- .env.staging:/home/numeris/.env
- .env:/home/numeris/.env
depends_on:
- mysql
labels:
@@ -96,8 +95,7 @@ services:
front-staging:
image: numerisisep/numeris-front:staging
container_name: numeris_front_staging
restart: unless-stopped
container_name: numeris_front
networks:
- caddy
labels:
@@ -106,9 +104,7 @@ services:
networks:
caddy:
name: caddy
# external: true
attachable: true
external: true
mysql:
volumes:
+9 -10
View File
@@ -3,46 +3,43 @@ services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
container_name: numeris_phpmyadmin
mysql:
image: mysql:5.7
container_name: numeris_mysql
environment:
MYSQL_DATABASE: 'numeris_testing'
MYSQL_DATABASE: 'numeris'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
container_name: numeris_mysql
back:
image: numerisisep/back:dev
container_name: numeris_back
build:
context: ./back
dockerfile: Dockerfile
environment:
DB_HOST: mysql
DB_PORT: 3306
DB_DATABASE: numeris_testing
DB_DATABASE: numeris
DB_USERNAME: root
DB_PASSWORD: ""
DB_PASSWORD:
volumes:
- ./back:/home/numeris
- /home/numeris/vendor
ports:
- ${BACK_PORT:-8000}:8000
- ${BACK_PORT:-8000}:80
links:
- mysql
depends_on:
- mysql
container_name: numeris_back
front:
image: numerisisep/front:dev
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile
@@ -53,3 +50,5 @@ services:
- back
ports:
- ${FRONT_PORT:-8080}:80
command: ng s --host 0.0.0.0
container_name: numeris_front
+1 -1
View File
@@ -5,5 +5,5 @@ COPY package.json yarn.lock /opt/numeris/
RUN yarn install
# RUN yarn add -g @angular/cli@7.3.9
COPY . .
RUN yarn run build
RUN yarn run build-prod
ENTRYPOINT [ "ng", "serve", "--port", "80" ]
+4 -5
View File
@@ -1,17 +1,16 @@
FROM node:11.15.0 as builder
ARG ENVIRONMENT=production
WORKDIR /opt/numeris
ENV PATH /opt/numeris/node_modules/.bin:$PATH
COPY package.json /opt/numeris/
COPY yarn.lock /opt/numeris/
RUN yarn install
# RUN yarn add -g @angular/cli@7.3.9
COPY . .
RUN yarn run build-$ENVIRONMENT
ENTRYPOINT [ "ng", "serve", "--configuration", "$ENVIRONMENT", "--port", "80" ]
RUN yarn run build-prod
ENTRYPOINT [ "ng", "serve", "--configuration", "production", "--port", "80" ]
FROM nginx
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx/mime.types /etc/nginx/mime.types
COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /opt/numeris/dist /usr/share/nginx/html
EXPOSE 80
-19
View File
@@ -47,25 +47,6 @@
"buildOptimizer": true,
"serviceWorker": true,
"ngswConfigPath": "src/ngsw-config.json"
},
"staging": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true,
"ngswConfigPath": "src/ngsw-config.json"
}
}
},
@@ -10,9 +10,5 @@ server {
index index.html;
location / {
try_files $uri $uri/ /index.html;
# types { application/octet-stream .pdf; }
}
location ~* \.pdf$ {
add_header Content-disposition "attachment; filename=$1";
}
}
-100
View File
@@ -1,100 +0,0 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/plain js;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/avif avif;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/wasm wasm;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
+1 -2
View File
@@ -6,8 +6,7 @@
"start": "ng serve",
"start-http": "http-server -c-1 dist",
"build": "ng build",
"build-production": "ng build --prod --c=production --output-path dist",
"build-staging": "ng build --prod -c=staging --output-path dist",
"build-prod": "ng build --prod --output-path dist",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
@@ -1,8 +0,0 @@
export const environment = {
production: true,
apiUrl: 'https://api.staging.numeris-isep.fr',
tokenName: 'numeris_token',
savEmail: 'sav.numeris@gmail.com',
messengerUrl: 'http://m.me/numerisisep',
captchaKey: '6Le3-skUAAAAAFQd5ffXB1PnyQUQDPsgQH4n1neo',
};