Compare commits
99
Commits
fixed-docker
...
staging
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a3140444 | ||
|
|
1b63f36b78 | ||
|
|
a23d66c17c | ||
|
|
f47e9879ea | ||
|
|
351b16bdad | ||
|
|
d468563877 | ||
|
|
6b6a21b05a | ||
|
|
955a720704 | ||
|
|
c71e626635 | ||
|
|
f51bdd1079 | ||
|
|
4e583fb6f9 | ||
|
|
ba866f2740 | ||
|
|
31ba36a112 | ||
|
|
241fd6fd8c | ||
|
|
ce3983bf6a | ||
|
|
48f3fd0e49 | ||
|
|
48ca638913 | ||
|
|
689ceda4cf | ||
|
|
d7e417cb98 | ||
|
|
1a8e9b4736 | ||
|
|
d63e790a97 | ||
|
|
bff6efb724 | ||
|
|
7e9558420e | ||
|
|
6b94e02805 | ||
|
|
fd60e0f2ba | ||
|
|
67da2a3b1b | ||
|
|
666b086b9c | ||
|
|
6cc1a490ee | ||
|
|
4a863d8a49 | ||
|
|
a11fc66741 | ||
|
|
c4ffa1a033 | ||
|
|
0c4ea7defc | ||
|
|
8545f7c5a2 | ||
|
|
adf9a355f2 | ||
|
|
9d83830b10 | ||
|
|
3c9211afc1 | ||
|
|
f10369bf9b | ||
|
|
097f7ec499 | ||
|
|
36f790b8e8 | ||
|
|
f06687cc8e | ||
|
|
ed52d1c390 | ||
|
|
535b3a0353 | ||
|
|
98bb8044d1 | ||
|
|
dd1a5922fb | ||
|
|
9c0b45a42b | ||
|
|
4576c1129e | ||
|
|
975fd7039b | ||
|
|
78a3dde67e | ||
|
|
edd19081e7 | ||
|
|
97d6b7c3f6 | ||
|
|
440c31b5ed | ||
|
|
935531cc2d | ||
|
|
373bce8c68 | ||
|
|
98c2959242 | ||
|
|
f266ac2a2e | ||
|
|
cb824b754e | ||
|
|
88cfeae153 | ||
|
|
6de9f97b93 | ||
|
|
a8950813fd | ||
|
|
fe6af9a979 | ||
|
|
261309f2cb | ||
|
|
5443898266 | ||
|
|
05df8e7513 | ||
|
|
0d5a03aaaa | ||
|
|
0eb934dad7 | ||
|
|
f53f610d65 | ||
|
|
b0bb350c3c | ||
|
|
059d957f09 | ||
|
|
8c383add3a | ||
|
|
83d5d75bff | ||
|
|
39a50ad2a4 | ||
|
|
a097bb11a7 | ||
|
|
fd4f021eec | ||
|
|
031e2ae992 | ||
|
|
cde020e710 | ||
|
|
fe106b43ca | ||
|
|
30c403deb6 | ||
|
|
5efe9e29ef | ||
|
|
bf1eb19369 | ||
|
|
5f3eb5399e | ||
|
|
b14654d2a5 | ||
|
|
4d4a423a6c | ||
|
|
79db3c1fcf | ||
|
|
13ff5bafe7 | ||
|
|
5041afe20d | ||
|
|
40cf30d84e | ||
|
|
0ac9e861eb | ||
|
|
083c62bf5d | ||
|
|
d377682495 | ||
|
|
5e93d72f14 | ||
|
|
66839cf38b | ||
|
|
99c79ab92f | ||
|
|
51dbf08c41 | ||
|
|
fc8c1611fa | ||
|
|
13bfdf606d | ||
|
|
4dc06d439d | ||
|
|
a61a4d76ff | ||
|
|
c364757cf4 | ||
|
|
a4409fe221 |
@@ -0,0 +1,91 @@
|
||||
name: Deploy production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
build-front:
|
||||
name: Build front
|
||||
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 front
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: front
|
||||
file: front/Dockerfile.production
|
||||
push: true
|
||||
tags: numerisisep/numeris-front:prod
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
|
||||
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
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: back
|
||||
file: back/Dockerfile.production
|
||||
push: true
|
||||
tags: numerisisep/numeris-back:prod
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
|
||||
|
||||
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.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
|
||||
@@ -0,0 +1,91 @@
|
||||
name: Deploy staging
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "staging"
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
build-front:
|
||||
name: Build and push front
|
||||
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 front
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
build-args: ENVIRONMENT=staging
|
||||
context: front
|
||||
file: front/Dockerfile.production
|
||||
push: true
|
||||
tags: numerisisep/numeris-front:staging
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
|
||||
build-back:
|
||||
name: Build and push 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
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
build-args: ENVIRONMENT=staging
|
||||
context: back
|
||||
file: back/Dockerfile.production
|
||||
push: true
|
||||
tags: numerisisep/numeris-back:staging
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
|
||||
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.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
|
||||
@@ -0,0 +1,111 @@
|
||||
name: Test docker build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
- "!master"
|
||||
- "!staging"
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
- v*
|
||||
|
||||
# Run tests for any PRs.
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
back-prod:
|
||||
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: Fake env file
|
||||
run: touch .env
|
||||
|
||||
- name: Build back prod
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: back
|
||||
dockerfile: Dockerfile.production
|
||||
push: false
|
||||
tags: numerisisep/back:prod
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
|
||||
front-prod:
|
||||
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: Fake env file
|
||||
run: touch .env
|
||||
|
||||
- name: Build front prod
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: front
|
||||
dockerfile: Dockerfile.production
|
||||
push: false
|
||||
tags: numerisisep/front:prod
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
|
||||
back-dev:
|
||||
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: Fake env file
|
||||
run: touch .env
|
||||
|
||||
- name: Build back dev
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: back
|
||||
dockerfile: Dockerfile
|
||||
push: false
|
||||
tags: numerisisep/back:dev
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
|
||||
front-dev:
|
||||
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: Fake env file
|
||||
run: touch .env
|
||||
|
||||
- name: Build front dev
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: front
|
||||
dockerfile: Dockerfile
|
||||
push: false
|
||||
tags: numerisisep/front:dev
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
.idea/
|
||||
.vscode/
|
||||
.env
|
||||
var/
|
||||
.env*
|
||||
var/
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
[](https://github.com/numeris-isep/numeris-v2/actions/workflows/prod.yml)
|
||||
[](https://github.com/numeris-isep/numeris-v2/actions/workflows/staging.yml)
|
||||
[](https://github.com/numeris-isep/numeris-v2/actions/workflows/test.yml)
|
||||
|
||||
# Numeris-v2
|
||||
|
||||
[](https://travis-ci.com/2Seg/numeris-v2)
|
||||
<!-- [](https://travis-ci.com/2Seg/numeris-v2) -->
|
||||
|
||||
> Created and maintened by [2Seg](https://github.com/2Seg)
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
Dockerfile
|
||||
Dockerfile.production
|
||||
.DS_Store
|
||||
vendor
|
||||
public/storage
|
||||
public/build
|
||||
.env
|
||||
.env.template
|
||||
|
||||
+13
-9
@@ -1,6 +1,4 @@
|
||||
FROM php:7.2-apache
|
||||
|
||||
RUN mkdir -p /home/numeris
|
||||
FROM php:7.4-apache
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update && apt-get install -y \
|
||||
@@ -8,7 +6,9 @@ RUN apt-get update && apt-get install -y \
|
||||
zip \
|
||||
unzip \
|
||||
nano \
|
||||
libpng-dev
|
||||
libpng-dev \
|
||||
libzip-dev
|
||||
|
||||
|
||||
# Install the PHP mcrypt pdo_mysql extension
|
||||
RUN docker-php-ext-install pdo_mysql gd zip
|
||||
@@ -17,22 +17,26 @@ 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 rewrite && service apache2 restart
|
||||
RUN a2dissite 000-default.conf && \
|
||||
a2ensite numeris.conf && \
|
||||
a2enmod headers && \
|
||||
a2enmod rewrite && \
|
||||
service apache2 restart
|
||||
# Enable php conf
|
||||
COPY docker/php/php.ini /usr/local/etc/php/conf.d/default.ini
|
||||
|
||||
COPY . /home/numeris
|
||||
WORKDIR /home/numeris
|
||||
COPY . .
|
||||
|
||||
# Composer install
|
||||
WORKDIR /home/numeris
|
||||
RUN composer install --no-interaction
|
||||
|
||||
# Final touch
|
||||
RUN . ~/.bashrc
|
||||
RUN apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
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/
|
||||
|
||||
WORKDIR /home/numeris
|
||||
# ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
|
||||
ENTRYPOINT ["php", "artisan", "serve", "--host", "0.0.0.0", "--port", "8080"]
|
||||
|
||||
+12
-10
@@ -1,6 +1,4 @@
|
||||
FROM php:7.2-apache
|
||||
|
||||
RUN mkdir -p /home/numeris
|
||||
FROM php:7.4-apache
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update && apt-get install -y \
|
||||
@@ -8,7 +6,8 @@ RUN apt-get update && apt-get install -y \
|
||||
zip \
|
||||
unzip \
|
||||
nano \
|
||||
libpng-dev
|
||||
libpng-dev \
|
||||
libzip-dev
|
||||
|
||||
# Install the PHP mcrypt pdo_mysql extension
|
||||
RUN docker-php-ext-install pdo_mysql gd zip
|
||||
@@ -16,25 +15,28 @@ 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 rewrite && service apache2 restart
|
||||
RUN a2dissite 000-default.conf && \
|
||||
a2ensite numeris.conf && \
|
||||
a2enmod headers && \
|
||||
a2enmod rewrite && \
|
||||
service apache2 restart
|
||||
# Enable php conf
|
||||
COPY docker/php/php.ini /usr/local/etc/php/conf.d/default.ini
|
||||
|
||||
COPY . /home/numeris
|
||||
WORKDIR /home/numeris
|
||||
COPY . .
|
||||
|
||||
### Back config ###
|
||||
WORKDIR /home/numeris
|
||||
RUN composer install --optimize-autoloader --no-dev --no-interaction
|
||||
|
||||
# Final touch
|
||||
RUN . ~/.bashrc
|
||||
RUN apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
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/
|
||||
|
||||
WORKDIR /home/numeris
|
||||
|
||||
RUN php artisan config:cache
|
||||
RUN php artisan route:cache
|
||||
|
||||
ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
|
||||
|
||||
+11
-3
@@ -1,7 +1,11 @@
|
||||
{
|
||||
"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": [
|
||||
@@ -14,6 +18,11 @@
|
||||
"name": "MinhNam Nguyen",
|
||||
"email": "nguyen.minhnam@hotmail.fr",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Marc Partensky",
|
||||
"email": "marc@marcpartensky.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
@@ -51,8 +60,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": [
|
||||
]
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
Generated
+2344
-880
File diff suppressed because it is too large
Load Diff
@@ -6,10 +6,22 @@
|
||||
# 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 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
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
LogLevel debug
|
||||
</Directory>
|
||||
|
||||
ErrorLog /var/log/apache2/numeris-error.log
|
||||
CustomLog /var/log/apache2/numeris-access.log combined
|
||||
ErrorLog /var/log/apache2/error.log
|
||||
CustomLog /var/log/apache2/access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/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
|
||||
|
||||
docker-php-entrypoint
|
||||
apache2-foreground
|
||||
@@ -1,6 +1,23 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
|
||||
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"]
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin:latest
|
||||
container_name: numeris_phpmyadmin
|
||||
@@ -24,18 +41,18 @@ services:
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- mysql
|
||||
ports:
|
||||
- 127.0.0.1:3306:3306
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./var/mysql:/var/lib/mysql
|
||||
# - /var/run/mysqld:/var/run/mysqld
|
||||
|
||||
back:
|
||||
image: numerisisep/numeris-back
|
||||
image: numerisisep/numeris-back:prod
|
||||
container_name: numeris_back
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: ./back
|
||||
dockerfile: Dockerfile.production
|
||||
networks:
|
||||
- caddy
|
||||
- mysql
|
||||
@@ -48,14 +65,11 @@ services:
|
||||
labels:
|
||||
caddy: api.numeris-isep.fr
|
||||
caddy.reverse_proxy: "{{upstreams 80}}"
|
||||
# caddy.reverse_proxy.header_down: -Access-Control-Allow-Origin
|
||||
|
||||
front:
|
||||
image: numerisisep/numeris-front
|
||||
image: numerisisep/numeris-front:prod
|
||||
container_name: numeris_front
|
||||
build:
|
||||
context: ./front
|
||||
dockerfile: Dockerfile.production
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- caddy
|
||||
labels:
|
||||
@@ -63,26 +77,38 @@ services:
|
||||
caddy.reverse_proxy: "{{upstreams 80}}"
|
||||
|
||||
|
||||
caddy:
|
||||
image: lucaslorentz/caddy-docker-proxy:ci-alpine
|
||||
back-staging:
|
||||
image: numerisisep/numeris-back:staging
|
||||
container_name: numeris_back_staging
|
||||
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"]
|
||||
- mysql
|
||||
env_file:
|
||||
- .env.staging
|
||||
volumes:
|
||||
- .env.staging:/home/numeris/.env
|
||||
depends_on:
|
||||
- mysql
|
||||
labels:
|
||||
caddy: api.staging.numeris-isep.fr
|
||||
caddy.reverse_proxy: "{{upstreams 80}}"
|
||||
|
||||
front-staging:
|
||||
image: numerisisep/numeris-front:staging
|
||||
container_name: numeris_front_staging
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- caddy
|
||||
labels:
|
||||
caddy: staging.numeris-isep.fr
|
||||
caddy.reverse_proxy: "{{upstreams 80}}"
|
||||
|
||||
networks:
|
||||
caddy:
|
||||
external: true
|
||||
name: caddy
|
||||
# external: true
|
||||
attachable: true
|
||||
mysql:
|
||||
|
||||
volumes:
|
||||
@@ -1,58 +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
|
||||
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: numerisisep/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: numerisisep/numeris-front
|
||||
container_name: numeris_front
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: ./front
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- 8000:80
|
||||
links:
|
||||
- back
|
||||
depends_on:
|
||||
- back
|
||||
+15
-18
@@ -3,45 +3,46 @@ 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
|
||||
environment:
|
||||
MYSQL_DATABASE: 'numeris'
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
||||
container_name: numeris_mysql
|
||||
environment:
|
||||
MYSQL_DATABASE: 'numeris_testing'
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
||||
|
||||
back:
|
||||
image: numerisisep/back:dev
|
||||
container_name: numeris_back
|
||||
build:
|
||||
context: ./back
|
||||
dockerfile: Dockerfile
|
||||
env_file:
|
||||
- back/.env
|
||||
environment:
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_PORT: ${DB_PORT}
|
||||
DB_DATABASE: ${DB_DATABASE}
|
||||
DB_USERNAME: ${DB_USERNAME}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
DB_HOST: mysql
|
||||
DB_PORT: 3306
|
||||
DB_DATABASE: numeris_testing
|
||||
DB_USERNAME: root
|
||||
DB_PASSWORD: ""
|
||||
volumes:
|
||||
- ./back:/home/numeris
|
||||
- /home/numeris/vendor
|
||||
ports:
|
||||
- ${BACK_PORT}:80
|
||||
- ${BACK_PORT:-8000}:8000
|
||||
links:
|
||||
- mysql
|
||||
depends_on:
|
||||
- mysql
|
||||
container_name: numeris_back
|
||||
|
||||
front:
|
||||
image: numerisisep/front:dev
|
||||
container_name: numeris_front
|
||||
build:
|
||||
context: ./front
|
||||
dockerfile: Dockerfile
|
||||
@@ -50,9 +51,5 @@ services:
|
||||
- /home/numeris/node_modules
|
||||
links:
|
||||
- back
|
||||
expose:
|
||||
- ${FRONT_PORT}
|
||||
ports:
|
||||
- ${FRONT_PORT}:${FRONT_PORT}
|
||||
command: ng s --host 0.0.0.0
|
||||
container_name: numeris_front
|
||||
- ${FRONT_PORT:-8080}:80
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
Dockerfile
|
||||
|
||||
+9
-18
@@ -1,18 +1,9 @@
|
||||
FROM node:11.15.0
|
||||
|
||||
RUN mkdir -p /home/numeris
|
||||
|
||||
ENV PATH /home/numeris/node_modules/.bin:$PATH
|
||||
|
||||
COPY package*.json /home/numeris/
|
||||
|
||||
# npm install
|
||||
WORKDIR /home/numeris
|
||||
RUN npm install
|
||||
RUN npm install -g @angular/cli@7.3.9
|
||||
|
||||
COPY . /home/numeris
|
||||
|
||||
RUN npm rebuild node-sass
|
||||
|
||||
WORKDIR /home/numeris
|
||||
FROM node:11.15.0 as builder
|
||||
WORKDIR /opt/numeris
|
||||
ENV PATH /opt/numeris/node_modules/.bin:$PATH
|
||||
COPY package.json yarn.lock /opt/numeris/
|
||||
RUN yarn install
|
||||
# RUN yarn add -g @angular/cli@7.3.9
|
||||
COPY . .
|
||||
RUN yarn run build
|
||||
ENTRYPOINT [ "ng", "serve", "--port", "80" ]
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
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
|
||||
COPY . .
|
||||
RUN yarn run build-$ENVIRONMENT
|
||||
ENTRYPOINT [ "ng", "serve", "--configuration", "$ENVIRONMENT", "--port", "80" ]
|
||||
|
||||
FROM nginx
|
||||
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY nginx/mime.types /etc/nginx/mime.types
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
COPY --from=builder /opt/numeris/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||
@@ -47,6 +47,25 @@
|
||||
"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"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
server_name 0.0.0.0;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
# types { application/octet-stream .pdf; }
|
||||
}
|
||||
location ~* \.pdf$ {
|
||||
add_header Content-disposition "attachment; filename=$1";
|
||||
}
|
||||
}
|
||||
Generated
-12862
File diff suppressed because it is too large
Load Diff
+3
-2
@@ -6,7 +6,8 @@
|
||||
"start": "ng serve",
|
||||
"start-http": "http-server -c-1 dist",
|
||||
"build": "ng build",
|
||||
"build-prod": "ng build --prod --output-path dist",
|
||||
"build-production": "ng build --prod --c=production --output-path dist",
|
||||
"build-staging": "ng build --prod -c=staging --output-path dist",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
@@ -60,6 +61,6 @@
|
||||
"protractor": "~5.4.2",
|
||||
"ts-node": "~8.0.3",
|
||||
"tslint": "~5.14.0",
|
||||
"typescript": "^3.2.4"
|
||||
"typescript": "3.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
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',
|
||||
};
|
||||
+8957
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user