Compare commits

..
105 Commits
Author SHA1 Message Date
marc 5c0ce828ca zerossl
Docker build test / build-back (push) Canceled after 0s
Docker build test / build-front (push) Canceled after 0s
2022-10-03 21:40:02 +02:00
marc d360d2e836 fix merge 2022-10-03 21:38:36 +02:00
marc c533e5191c fix spacing 2022-10-03 21:38:10 +02:00
marc 156bb5d014 zerossl 2022-10-03 21:35:37 +02:00
marc 1dfe522791 email 2022-10-03 21:33:48 +02:00
marc fd46fdef0a links 2022-10-03 21:20:03 +02:00
marc 56d511e791 link is back 2022-10-03 21:14:10 +02:00
marc 3cfa7743c5 no binds 2022-10-03 21:10:05 +02:00
marc c880533753 not external 2022-10-03 21:09:15 +02:00
marc 3748e75ee3 traefik letsencrypt 2022-10-03 21:08:43 +02:00
marc d3aea22fe0 cmd 2022-10-03 21:08:13 +02:00
marc 092347558a traefik 2022-10-03 21:07:14 +02:00
marc 5a73a82eed fix ports 2022-10-03 20:25:51 +02:00
marc 84c5fca9ae Merge branch 'docker-compose' into fix-numeris 2022-10-03 20:23:41 +02:00
marc 09f6858326 external true 2022-10-03 20:23:36 +02:00
marc 7d86256821 Merge branch 'docker-compose' into fix-numeris 2022-10-03 20:21:54 +02:00
marc 6d3fc1b774 bye 2022-10-03 20:21:49 +02:00
marc 900eeb79cc Merge branch 'docker-compose' into fix-numeris 2022-10-03 20:19:13 +02:00
marc 326cce6fd8 image 2022-10-03 20:18:46 +02:00
marc c8139e01d6 Merge branch 'docker-compose' into fix-numeris 2022-10-03 20:16:41 +02:00
marc 1f9a0b1bb9 var run docker 2022-10-03 20:16:31 +02:00
marc 9fc3242be7 Merge branch 'docker-compose' into fix-numeris 2022-10-03 19:45:50 +02:00
marc 4d6fe9941b dash 2022-10-03 19:45:44 +02:00
marc ad48ee11ee fix conflict 2022-10-03 19:41:29 +02:00
marc 418de3d52d fix conflict 2022-10-03 19:40:51 +02:00
marc 861551f209 Merge branch 'dockerignore' into fix-numeris 2022-09-28 16:45:22 +02:00
marc 4942daea62 all env files 2022-09-28 16:32:39 +02:00
marc c7aaebf8a1 Merge branch 'dockerignore' into fix-numeris 2022-09-28 16:30:13 +02:00
marc 0cf2367cbe ignoring env file when building image 2022-09-28 16:30:05 +02:00
marc 1c4789a4a9 Merge branch 'php7.4' into fix-numeris 2022-09-24 20:11:17 +02:00
marc eaea9577ea home is back instead of opt 2022-09-24 20:11:10 +02:00
marc da3f2fdb1b Merge branch 'php7.4' into fix-numeris 2022-09-21 16:49:30 +02:00
marc ca176b628a entrypoint for prod is a must 2022-09-21 16:49:20 +02:00
marc 85cd2b8d5e Merge branch 'docker-compose' into fix-numeris 2022-09-21 16:48:36 +02:00
marc b7c51c7f3c production 2022-09-21 16:48:27 +02:00
marc 813056db7e Merge branch 'php7.4' into fix-numeris 2022-09-21 16:41:19 +02:00
marc fc7a469181 apache2-foreground 2022-09-21 16:40:56 +02:00
marc a3090ae8de Merge branch 'docker-compose' into fix-numeris 2022-09-21 16:35:00 +02:00
marc 0ba9918b75 restart unless-stopped in testing 2022-09-21 16:34:33 +02:00
marc 089113fe16 Merge branch 'php7.4' into fix-numeris 2022-09-21 16:30:46 +02:00
marc decd443031 rip exec 2022-09-21 16:30:23 +02:00
marc e7d31e8397 Merge branch 'front-multistage' into fix-numeris-front-multistage
Docker build test / build-back (push) Canceled after 0s
Docker build test / build-front (push) Canceled after 0s
2022-09-21 16:25:53 +02:00
marc 80aa16c844 new ports 2022-09-21 16:25:45 +02:00
marc a2d679457d Merge branch 'front-multistage' into fix-numeris-front-multistage 2022-09-21 16:22:44 +02:00
marc 51eeb3d000 Merge remote-tracking branch 'origin/docker-compose' into front-multistage 2022-09-21 16:20:32 +02:00
marc ec7e146e6d Merge branch 'front-multistage' into fix-numeris-front-multistage 2022-09-21 11:03:35 +02:00
marc 08f70a7a61 ci 2022-09-21 11:03:09 +02:00
marc df196720b8 Merge branch 'front-multistage' into fix-numeris-front-multistage 2022-09-21 10:41:04 +02:00
marc e844eafd41 opt/numeris 2022-09-21 10:40:50 +02:00
marc b22b25f386 nginx.conf 2022-09-21 10:38:00 +02:00
marc bde444a55a nginx 2022-09-21 10:38:00 +02:00
marc def2fc0335 nginx.conf 2022-09-21 10:37:25 +02:00
marc ec4a85ecbe nginx 2022-09-21 10:36:47 +02:00
marc f44662e487 Merge branch 'front-multistage' into fix-numeris-front-multistage 2022-09-21 10:32:53 +02:00
marc 694f0b0d25 multistage 2022-09-21 10:32:33 +02:00
marc 19b6f3031e Merge branch 'caddy' into fix-numeris 2022-09-21 01:27:59 +02:00
marc 8095851fb9 typo 2022-09-21 01:23:49 +02:00
marc a926746659 Merge branch 'caddy' into fix-numeris 2022-09-21 01:09:22 +02:00
marc f18008507d caddy network 2022-09-21 01:09:12 +02:00
marc 427d23362b Merge branch 'caddy' into fix-numeris 2022-09-21 01:01:13 +02:00
marc 7a90266be6 caddy container joins the party 2022-09-21 01:00:32 +02:00
marc b1e1f4d65e Merge branch 'docker-compose' into fix-numeris 2022-09-20 16:12:15 +02:00
marc 6c60e3792c image names even though they point towards nothing 2022-09-20 16:11:03 +02:00
marc 1e0f5207b2 Merge branch 'docker-compose' into fix-numeris 2022-09-20 15:44:56 +02:00
marc 140fb1d7d8 3.9 2022-09-20 15:44:48 +02:00
marc 4665aa40db Merge branch 'php7.4' into fix-numeris 2022-09-20 15:39:08 +02:00
marc 6ee3e34d0c forcing every command 2022-09-20 15:38:58 +02:00
marc 5eb82ae8b7 Merge branch 'php7.4' into fix-numeris 2022-09-20 15:37:44 +02:00
marc d2ca350fd4 executable 2022-09-20 15:37:34 +02:00
marc 744f963046 Merge branch 'php7.4' into fix-numeris 2022-09-20 15:36:06 +02:00
marc ddf8132963 absolute path 2022-09-20 15:35:54 +02:00
marc ccf5d87a7c Merge branch 'php7.4' into fix-numeris 2022-09-20 15:34:04 +02:00
marc 7e14892de1 overloading entrypoint 2022-09-20 15:33:56 +02:00
marc 910fb9766b Merge branch 'docker-compose' into fix-numeris 2022-09-20 15:18:56 +02:00
marc b54c69ae4c names are back 2022-09-20 15:18:09 +02:00
marc ce259181b9 mysql_testing 2022-09-20 14:38:33 +02:00
marc c5307c8574 Merge branch 'docker-compose' into fix-numeris 2022-09-20 14:36:39 +02:00
marc 77ca1911ed bind mount is back 2022-09-20 14:36:31 +02:00
marc 278fea29b7 Merge branch 'github-action' into fix-numeris 2022-09-19 11:00:16 +02:00
marc 4ad3c839e2 Merge branch 'docker-compose' into fix-numeris 2022-09-19 10:59:47 +02:00
marc 93732c9fd1 Merge branch 'front' into fix-numeris 2022-09-19 10:59:43 +02:00
marc 6533ab3b30 entrypoint is front is a must 2022-09-19 10:59:19 +02:00
marc fb944657b5 dockerfile 2022-09-19 10:57:56 +02:00
marc 5e3dfec004 phpmyadmin might come in handy 2022-09-19 10:32:09 +02:00
marc b834f1d27b fix names 2022-09-19 10:27:59 +02:00
marc 3a374a10bc front too 2022-09-17 17:51:40 +02:00
marc 0378a0a224 front too 2022-09-16 19:54:08 +02:00
marc d4804bd214 touch .env 2022-09-16 19:47:47 +02:00
marc 897880c9f0 run every week to test the image resilience over external package changes 2022-09-16 19:44:37 +02:00
marc be946356ae build back and front 2022-09-16 19:37:09 +02:00
marc fea17b735c docker build test 2022-09-16 19:33:58 +02:00
marc 07dbb05443 opt 2022-09-16 19:30:39 +02:00
marc d18074c556 Merge branch 'docker-compose' into php7.4 2022-09-16 19:16:17 +02:00
marc 3301654cb7 fake .env 2022-09-16 19:09:32 +02:00
marc a98a4ca05a master only 2022-09-16 19:08:03 +02:00
marc b317fd82b3 Merge branch 'docker-compose' into github-action 2022-09-16 19:07:13 +02:00
marc a6b9888cfe production 2022-09-16 19:06:08 +02:00
marc 3b18e4dd36 2 github actions 2022-09-16 18:59:09 +02:00
marc 6d40239a13 Merge branch 'back-dockerfile-clean' into php7.4 2022-09-16 18:47:05 +02:00
marc 57fb4d7639 clean dev 2022-09-16 18:46:53 +02:00
marc 36ea133390 clean production 2022-09-16 18:46:21 +02:00
marc 9f28d25eb7 production too 2022-09-16 18:43:47 +02:00
marc 8f69143715 3.9 2022-09-16 18:43:11 +02:00
marc 739212ea0a update to php7.4 - build ok 2022-09-16 18:39:19 +02:00
marc c64058fff0 update of composer 2022-09-15 16:45:37 +02:00
20 changed files with 13064 additions and 9244 deletions
+1 -2
View File
@@ -4,8 +4,7 @@
.vscode
.DS_Store
docker-compose*.yml
.env
.env.template
.env*
# Back
back/.DS_Store
+3 -52
View File
@@ -14,8 +14,7 @@ on:
pull_request:
jobs:
build-front:
name: Build front
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -32,58 +31,10 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push front
uses: docker/build-push-action@v3
with:
context: front
dockerfile: Dockerfile
push: true
tags: numerisisep/numeris-front:latest
build-back:
name: Build back
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push back
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: back
dockerfile: Dockerfile.production
push: true
tags: numerisisep/numeris-back:latest
pull-and-recreate:
name: Pull and recreate
needs:
- build-front
- build-back
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
# password: ${{ secrets.PASSWORD }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd numeris
git pull
docker-compose -f docker-compose.production.yml pull
docker-compose -f docker-compose.production.yml up -d --force-recreate
tags: marcpartensky/numeris-back:latest
-2
View File
@@ -2,5 +2,3 @@
vendor
public/storage
public/build
.env
.env.template
+1 -5
View File
@@ -17,11 +17,7 @@ RUN docker-php-ext-install pdo_mysql gd zip
COPY --from=composer /usr/bin/composer /usr/bin/composer
# Enable apache conf
COPY docker/apache/numeris.conf /etc/apache2/sites-available/numeris.conf
RUN a2dissite 000-default.conf && \
a2ensite numeris.conf && \
a2enmod headers && \
a2enmod rewrite && \
service apache2 restart
RUN a2dissite 000-default.conf && a2ensite numeris.conf && a2enmod rewrite && service apache2 restart
# Enable php conf
COPY docker/php/php.ini /usr/local/etc/php/conf.d/default.ini
+1 -5
View File
@@ -15,11 +15,7 @@ RUN docker-php-ext-install pdo_mysql gd zip
COPY --from=composer /usr/bin/composer /usr/bin/composer
# Enable apache conf
COPY docker/apache/numeris.conf /etc/apache2/sites-available/numeris.conf
RUN a2dissite 000-default.conf && \
a2ensite numeris.conf && \
a2enmod headers && \
a2enmod rewrite && \
service apache2 restart
RUN a2dissite 000-default.conf && a2ensite numeris.conf && a2enmod rewrite && service apache2 restart
# Enable php conf
COPY docker/php/php.ini /usr/local/etc/php/conf.d/default.ini
+3 -11
View File
@@ -1,11 +1,7 @@
{
"name": "2seg/numeris-v2",
"description": "Home of the new website of Numéris.",
"keywords": [
"Numéris",
"association",
"website"
],
"keywords": ["Numéris", "association", "website"],
"license": "MIT",
"type": "project",
"authors": [
@@ -18,11 +14,6 @@
"name": "MinhNam Nguyen",
"email": "nguyen.minhnam@hotmail.fr",
"role": "Developer"
},
{
"name": "Marc Partensky",
"email": "marc@marcpartensky.com",
"role": "Developer"
}
],
"require": {
@@ -60,7 +51,8 @@
},
"extra": {
"laravel": {
"dont-discover": []
"dont-discover": [
]
}
},
"scripts": {
+2 -5
View File
@@ -6,13 +6,10 @@
# Force HTTPS when X-Forwarded-Proto is passed as HTTPS
# Useful when the reverse proxy is in HTTPS
SetEnvIf x-forwarded-proto https HTTPS=on
# Header set Access-Control-Allow-Origin "*"
# Header set Access-Control-Allow-Origin "numeris-isep.fr"
Header set Access-Control-Allow-Origin "https://numeris-isep.fr"
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
ErrorLog /var/log/apache2/numeris-error.log
CustomLog /var/log/apache2/numeris-access.log combined
</VirtualHost>
+3 -7
View File
@@ -1,12 +1,8 @@
#!/usr/bin/env sh
php artisan key:generate
# php artisan key:generate --force
php artisan jwt:secret
# php artisan jwt:secret --force
# php artisan cache:clear
php artisan config:clear
php artisan migrate:refresh
php artisan key:generate --force
php artisan jwt:secret --force
php artisan migrate:refresh --seed --force
docker-php-entrypoint
apache2-foreground
+61 -32
View File
@@ -5,18 +5,19 @@ services:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
restart: unless-stopped
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
networks:
- caddy
- traefik
- mysql
labels:
caddy: phpmyadmin.numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
traefik.enable: "true"
traefik.http.routers.phpmyadmin.rule: Host(`phpmyadmin.numeris-isep.fr`)
traefik.http.routers.phpmyadmin.entrypoints: websecure
traefik.http.routers.phpmyadmin.tls.certresolver: zerossl
traefik.http.services.phpmyadmin.loadbalancer.server.port: 80
mysql:
image: mysql:5.7
@@ -30,61 +31,89 @@ services:
- ./var/mysql:/var/lib/mysql
back:
image: numerisisep/numeris-back
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile.production
networks:
- caddy
- traefik
- mysql
env_file:
- .env
volumes:
- .env:/home/numeris/.env
depends_on:
- mysql
labels:
caddy: api.numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
# caddy.reverse_proxy.header_down: -Access-Control-Allow-Origin
traefik.enable: "true"
traefik.http.routers.back.rule: Host(`api.numeris-isep.fr`)
traefik.http.routers.back.entrypoints: websecure
traefik.http.routers.back.tls.certresolver: zerossl
traefik.http.services.back.loadbalancer.server.port: 80
front:
image: numerisisep/numeris-front
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile.production
dockerfile: Dockerfile
networks:
- caddy
- traefik
depends_on:
- back
labels:
caddy: numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
traefik.enable: "true"
traefik.http.routers.front.rule: Host(`numeris-isep.fr`)
traefik.http.routers.front.entrypoints: websecure
traefik.http.routers.front.tls.certresolver: zerossl
traefik.http.services.front.loadbalancer.server.port: 80
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
traefik:
image: traefik
restart: unless-stopped
environment:
CADDY_INGRESS_NETWORKS: caddy
command:
# ## Provider Settings - https://docs.traefik.io/providers/docker/#provider-configuration ##
# # - --providers.docker.exposedbydefault=false # <== Don't expose every container to traefik, only expose enabled ones
# - --providers.file.filename=/dynamic.yaml # <== Referring to a dynamic configuration file
- --providers.docker.network=web # <== Operate on the docker network named web
- --providers.docker=true # <== Enabling docker as the provider for traefik
# ## API Settings - https://docs.traefik.io/operations/api/, endpoints - https://docs.traefik.io/operations/api/#endpoints ##
# - --api.insecure=false # <== Enabling insecure api, NOT RECOMMENDED FOR PRODUCTION
- --api.dashboard=true
- --api.debug=true # <== Enabling additional endpoints for debugging and profiling
# ## Entrypoints Settings - https://docs.traefik.io/routing/entrypoints/#configuration ##
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
# - --certificatesresolvers.tls.acme.email = support@numeris-isep.fr
# - --certificatesresolvers.tls.acme.tlschallenge=true # <== Enable TLS-ALPN-01 to generate and renew ACME certs - --certificatesresolvers.tls.acme.email=marc.partensky@gmail.com
# - --certificatesresolvers.tls.acme.storage=/letsencrypt/acme.json # Log Settings (options: ERROR, DEBUG, PANIC, FATAL, WARN, INFO) - https://docs.traefik.io/observability/logs/ ##
- --certificatesresolvers.zerossl.acme.email=support@numeris-isep.fr
- --certificatesresolvers.zerossl.acme.tlschallenge=true # <== Enable TLS-ALPN-01 to generate and renew ACME certs - --certificatesresolvers.tls.acme.email=marc.partensky@gmail.com
- --certificatesresolvers.zerossl.acme.storage=/zerossl/acme.json # Log Settings (options: ERROR, DEBUG, PANIC, FATAL, WARN, INFO) - https://docs.traefik.io/observability/logs/ ##
- --log.level=DEBUG # <== Setting the level of the logs from traefik
- --entrypoints.web.http.redirections.entryPoint.to=websecure
- --entrypoints.web.http.redirections.entryPoint.scheme=https
- --entrypoints.web.http.redirections.entrypoint.permanent=true
ports:
- "80:80"
- "443:443"
volumes:
# docker rootless daemon socket https://docs.docker.com/engine/security/rootless/
- /var/run/docker.sock:/var/run/docker.sock
- caddy_data:/data
networks:
- caddy
healthcheck:
test: ["CMD", "curl", "-f", "localhost:80"]
- traefik
volumes:
# - ./traefik.yml:/traefik.yml # static configuration
# - ./dynamic.yml:/dynamic.yml
- traefik_letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
traefik.enable: "true"
traefik.http.routers.traefik.rule: Host(`traefik.numeris-isep.fr`)
traefik.http.routers.traefik.service: api@internal
traefik.http.routers.traefik.entrypoints: websecure
traefik.http.routers.traefik.tls.certresolver: zerossl
traefik.docker.network: traefik
networks:
caddy:
external: true
traefik:
mysql:
volumes:
caddy_data:
traefik_letsencrypt:
mysql:
-90
View File
@@ -1,90 +0,0 @@
version: "3.9"
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
restart: unless-stopped
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
networks:
- caddy
- mysql
labels:
caddy: phpmyadmin.staging.numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
# mysql:
# image: mysql:5.7
# container_name: numeris_mysql
# restart: unless-stopped
# networks:
# - mysql
# env_file:
# - .env
# volumes:
# - ./var/mysql:/var/lib/mysql
back:
image: numerisisep/numeris-back
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile.production
networks:
- caddy
- mysql
env_file:
- .env
volumes:
- .env:/home/numeris/.env
depends_on:
- mysql
labels:
caddy: api.staging.numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
# caddy.reverse_proxy.header_down: -Access-Control-Allow-Origin
front:
image: numerisisep/numeris-front
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile.production
networks:
- caddy
labels:
caddy: staging.numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
# caddy:
# image: lucaslorentz/caddy-docker-proxy:ci-alpine
# restart: unless-stopped
# environment:
# CADDY_INGRESS_NETWORKS: caddy
# ports:
# - "80:80"
# - "443:443"
# volumes:
# # docker rootless daemon socket https://docs.docker.com/engine/security/rootless/
# - /var/run/docker.sock:/var/run/docker.sock
# - caddy_data:/data
# networks:
# - caddy
# healthcheck:
# test: ["CMD", "curl", "-f", "localhost:80"]
networks:
caddy:
external: true
mysql:
volumes:
caddy_data:
mysql:
+58
View File
@@ -0,0 +1,58 @@
version: "3.9"
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
restart: unless-stopped
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
volumes:
- ./var/mysql_testing:/var/lib/mysql
mysql:
image: mysql:5.7
container_name: numeris_mysql
restart: unless-stopped
environment:
MYSQL_DATABASE: 'numeris_testing'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
back:
image: numeris-back
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile
environment:
DB_CONNECTION: testing
DB_HOST_TESTING: mysql
DB_PORT_TESTING: 3306
DB_DATABASE_TESTING: numeris_testing
DB_USERNAME_TESTING: root
DB_PASSWORD_TESTING:
ports:
- 8080:80
links:
- mysql
depends_on:
- mysql
front:
image: numeris-front
container_name: numeris_front
restart: unless-stopped
build:
context: ./front
dockerfile: Dockerfile
ports:
- 8000:80
links:
- back
depends_on:
- back
+17 -13
View File
@@ -1,4 +1,4 @@
version: "3.9"
version: '3'
services:
phpmyadmin:
@@ -9,46 +9,50 @@ services:
- mysql:db
depends_on:
- mysql
container_name: numeris_phpmyadmin
mysql:
image: mysql:5.7
environment:
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
env_file:
- ./back/.env
- back/.env
environment:
DB_HOST: ${DB_HOST:-mysql}
DB_PORT: ${DB_PORT:-3306}
DB_DATABASE: ${DB_DATABASE:-numeris}
DB_USERNAME: ${DB_USERNAME:-root}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
volumes:
- ./back:/home/numeris
- /home/numeris/vendor
ports:
- ${BACK_PORT:-8080}:80
- ${BACK_PORT}:80
links:
- mysql
depends_on:
- mysql
container_name: numeris_back
front:
image: numerisisep/front:dev
container_name: numeris-front
build:
context: ./front
dockerfile: Dockerfile
volumes:
- ./front/src:/home/numeris/src
- /home/numeris/node_modules
links:
- back
expose:
- ${FRONT_PORT}
ports:
- ${FRONT_PORT:-4200}:80
# command: ng serve --host 0.0.0.0
- ${FRONT_PORT}:${FRONT_PORT}
command: ng s --host 0.0.0.0
container_name: numeris_front
-1
View File
@@ -1,4 +1,3 @@
.DS_Store
node_modules/
dist/
Dockerfile
+11 -10
View File
@@ -1,16 +1,17 @@
FROM node:11.15.0 as builder
LABEL source="https://github.com/numerisisep/numeris-v2"
LABEL maintainer="support@numeris-isep.fr"
WORKDIR /opt/numeris
ENV PATH /opt/numeris/node_modules/.bin:$PATH
COPY package.json yarn.lock ./
RUN yarn install
# RUN yarn add -g @angular/cli@7.3.9
COPY package*.json /opt/numeris/
RUN npm ci
RUN npm install -g @angular/cli@7.3.9
COPY . .
RUN yarn run build-prod
RUN npm rebuild node-sass
RUN npm run build-prod
ENTRYPOINT [ "ng", "s", "--host", "0.0.0.0" ]
FROM nginx
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
ENTRYPOINT [ "ng", "serve", "--host", "0.0.0.0", "--port", "80" ]
ENTRYPOINT ["nginx", "-g", "daemon off;"]
-16
View File
@@ -1,16 +0,0 @@
FROM node:11.15.0 as builder
WORKDIR /opt/numeris
ENV PATH /opt/numeris/node_modules/.bin:$PATH
COPY package.json yarn.lock ./
RUN yarn install
# RUN yarn add -g @angular/cli@7.3.9
COPY . .
RUN yarn run build-prod
ENTRYPOINT [ "ng", "serve", "--configuration", "production", "--port", "80" ]
FROM nginx
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
ENTRYPOINT ["nginx", "-g", "daemon off;"]
+16 -11
View File
@@ -1,14 +1,19 @@
server {
gzip on;
gzip_types text/plain text/css application/javascript;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
listen 80;
sendfile on;
default_type application/octet-stream;
gzip on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 1100;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 9;
listen 80;
server_name 0.0.0.0;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html =404;
}
}
+12862
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -60,6 +60,6 @@
"protractor": "~5.4.2",
"ts-node": "~8.0.3",
"tslint": "~5.14.0",
"typescript": "3.1.1"
"typescript": "^3.2.4"
}
}
-8957
View File
File diff suppressed because it is too large Load Diff
+24 -24
View File
@@ -37,83 +37,83 @@ reload: stop start
#############################
back-install:
docker exec -it numeris-back composer install
docker exec -it numeris_back composer install
back-update:
docker exec -it numeris-back composer update
docker exec -it numeris_back composer update
front-install:
docker exec -it numeris-front npm install
docker exec -it numeris_front npm install
front-update:
docker exec -it numeris-front npm update
docker exec -it numeris_front npm update
front-fix-vulnerabilities:
docker exec -it numeris-front npm audit fix
docker exec -it numeris_front npm audit fix
## Shell commands
###################
shell-back:
docker exec -it numeris-back bash
docker exec -it numeris_back bash
shell-front:
docker exec -it numeris-front bash
docker exec -it numeris_front bash
shell-sql:
docker exec -it numeris-mysql bash
docker exec -it numeris_mysql bash
tinker:
docker exec -it numeris-back sh -c 'php artisan tinker'
docker exec -it numeris_back sh -c 'php artisan tinker'
## Database commands
######################
db-reset:
docker exec -it numeris-back sh -c 'php artisan migrate:refresh --seed'
docker exec -it numeris_back sh -c 'php artisan migrate:refresh --seed'
migrate:
docker exec -it numeris-back sh -c 'php artisan migrate'
docker exec -it numeris_back sh -c 'php artisan migrate'
migrate-prod:
docker exec -t numeris-back sh -c 'php artisan migrate --force'
docker exec -t numeris_back sh -c 'php artisan migrate --force'
db-refresh:
docker exec -it numeris-back sh -c 'php artisan migrate:refresh'
docker exec -it numeris_back sh -c 'php artisan migrate:refresh'
migrate-rollback:
docker exec -it numeris-back sh -c 'php artisan migrate:rollback'
docker exec -it numeris_back sh -c 'php artisan migrate:rollback'
db-seed:
docker exec -it numeris-back sh -c 'php artisan db:seed'
docker exec -it numeris_back sh -c 'php artisan db:seed'
## Test commands
###################
test:
docker exec -it numeris-back sh -c 'vendor/bin/phpunit'
docker exec -it numeris_back sh -c 'vendor/bin/phpunit'
## Utils commands
###################
log-back:
docker exec -it numeris-back sh -c 'less +G storage/logs/laravel.log'
docker exec -it numeris_back sh -c 'less +G storage/logs/laravel.log'
config-clear:
docker exec numeris-back sh -c 'php artisan config:clear'
docker exec numeris-back sh -c 'php artisan cache:clear'
docker exec numeris-back sh -c 'php artisan route:clear'
docker exec numeris_back sh -c 'php artisan config:clear'
docker exec numeris_back sh -c 'php artisan cache:clear'
docker exec numeris_back sh -c 'php artisan route:clear'
config-cache:
docker exec numeris-back sh -c 'php artisan route:cache'
docker exec numeris-back sh -c 'php artisan config:cache'
docker exec numeris_back sh -c 'php artisan route:cache'
docker exec numeris_back sh -c 'php artisan config:cache'
key-generate:
docker exec numeris-back sh -c 'php artisan key:generate'
docker exec numeris_back sh -c 'php artisan key:generate'
jwt-secret:
docker exec numeris-back sh -c 'php artisan jwt:secret'
docker exec numeris_back sh -c 'php artisan jwt:secret'