Compare commits
37
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd4eb1d8ee | ||
|
|
af5089f2a0 | ||
|
|
f0b2633cfb | ||
|
|
bf1eb19369 | ||
|
|
65e45f2d56 | ||
|
|
29322edd5e | ||
|
|
b03f1cdbe6 | ||
|
|
b3f0274d1b | ||
|
|
1fbd976753 | ||
|
|
e26d352601 | ||
|
|
5f3eb5399e | ||
|
|
ead6da4832 | ||
|
|
b14654d2a5 | ||
|
|
16864bb251 | ||
|
|
bbaefbb18d | ||
|
|
4d4a423a6c | ||
|
|
249963ced0 | ||
|
|
6407ca2880 | ||
|
|
156eb02ce0 | ||
|
|
79db3c1fcf | ||
|
|
13ff5bafe7 | ||
|
|
5041afe20d | ||
|
|
40cf30d84e | ||
|
|
0ac9e861eb | ||
|
|
083c62bf5d | ||
|
|
d377682495 | ||
|
|
5e93d72f14 | ||
|
|
66839cf38b | ||
|
|
99c79ab92f | ||
|
|
51dbf08c41 | ||
|
|
fc8c1611fa | ||
|
|
13bfdf606d | ||
|
|
4dc06d439d | ||
|
|
826bf35bc4 | ||
|
|
a61a4d76ff | ||
|
|
c364757cf4 | ||
|
|
a4409fe221 |
+2
-1
@@ -4,7 +4,8 @@
|
||||
.vscode
|
||||
.DS_Store
|
||||
docker-compose*.yml
|
||||
.env*
|
||||
.env
|
||||
.env.template
|
||||
|
||||
# Back
|
||||
back/.DS_Store
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
name: Docker build test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
- "!master"
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
- v*
|
||||
|
||||
# Run tests for any PRs.
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
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: Fake env file
|
||||
run: touch .env
|
||||
|
||||
- name: Build
|
||||
run: docker-compose -f docker-compose.production.yml build back
|
||||
|
||||
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: Fake env file
|
||||
run: touch .env
|
||||
|
||||
- name: Build
|
||||
run: docker-compose -f docker-compose.production.yml build front
|
||||
@@ -1,40 +0,0 @@
|
||||
name: Docker
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 4 * * 0" # run every sunday at 4 am to test if the image builds correctly given that changes of debian or compose packages can break the image
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
- v*
|
||||
|
||||
# Run tests for any PRs.
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
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 Docker images
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: back
|
||||
dockerfile: Dockerfile.production
|
||||
push: true
|
||||
tags: marcpartensky/numeris-back:latest
|
||||
@@ -0,0 +1,88 @@
|
||||
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
|
||||
dockerfile: Dockerfile
|
||||
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
|
||||
dockerfile: 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 up -d --force-recreate
|
||||
@@ -0,0 +1,86 @@
|
||||
name: Deploy staging
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "staging"
|
||||
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
|
||||
dockerfile: Dockerfile
|
||||
push: true
|
||||
tags: numerisisep/numeris-front:staging
|
||||
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
|
||||
dockerfile: 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 up -d --force-recreate
|
||||
@@ -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,3 +2,5 @@
|
||||
vendor
|
||||
public/storage
|
||||
public/build
|
||||
.env
|
||||
.env.template
|
||||
|
||||
+5
-1
@@ -17,7 +17,11 @@ 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
|
||||
|
||||
|
||||
@@ -15,7 +15,11 @@ 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
|
||||
|
||||
|
||||
+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": {
|
||||
|
||||
@@ -6,10 +6,13 @@
|
||||
# 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/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>
|
||||
|
||||
+7
-3
@@ -1,8 +1,12 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
php artisan key:generate --force
|
||||
php artisan jwt:secret --force
|
||||
php artisan migrate:refresh --seed --force
|
||||
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,61 +41,66 @@ 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:prod
|
||||
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
|
||||
networks:
|
||||
- caddy
|
||||
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:prod
|
||||
container_name: numeris_front
|
||||
build:
|
||||
context: ./front
|
||||
dockerfile: Dockerfile
|
||||
networks:
|
||||
- caddy
|
||||
depends_on:
|
||||
- back
|
||||
labels:
|
||||
caddy: numeris-isep.fr
|
||||
caddy.reverse_proxy: "{{upstreams 80}}"
|
||||
|
||||
|
||||
caddy:
|
||||
image: lucaslorentz/caddy-docker-proxy:ci-alpine
|
||||
back-staging:
|
||||
image: numerisisep/numeris-back:staging
|
||||
container_name: numeris_back
|
||||
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
|
||||
volumes:
|
||||
- .env:/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
|
||||
networks:
|
||||
- caddy
|
||||
labels:
|
||||
caddy: staging.numeris-isep.fr
|
||||
caddy.reverse_proxy: "{{upstreams 80}}"
|
||||
|
||||
networks:
|
||||
caddy:
|
||||
@@ -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: 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
|
||||
+7
-11
@@ -22,19 +22,17 @@ services:
|
||||
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
|
||||
DB_USERNAME: root
|
||||
DB_PASSWORD:
|
||||
volumes:
|
||||
- ./back:/home/numeris
|
||||
- /home/numeris/vendor
|
||||
ports:
|
||||
- ${BACK_PORT}:80
|
||||
- ${BACK_PORT:-8000}:80
|
||||
links:
|
||||
- mysql
|
||||
depends_on:
|
||||
@@ -50,9 +48,7 @@ services:
|
||||
- /home/numeris/node_modules
|
||||
links:
|
||||
- back
|
||||
expose:
|
||||
- ${FRONT_PORT}
|
||||
ports:
|
||||
- ${FRONT_PORT}:${FRONT_PORT}
|
||||
- ${FRONT_PORT:-8080}:80
|
||||
command: ng s --host 0.0.0.0
|
||||
container_name: numeris_front
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
Dockerfile
|
||||
|
||||
+5
-13
@@ -1,17 +1,9 @@
|
||||
FROM node:11.15.0 as builder
|
||||
WORKDIR /opt/numeris
|
||||
ENV PATH /opt/numeris/node_modules/.bin:$PATH
|
||||
COPY package*.json /opt/numeris/
|
||||
RUN npm ci
|
||||
RUN npm install -g @angular/cli@7.3.9
|
||||
COPY package.json yarn.lock /opt/numeris/
|
||||
RUN yarn install
|
||||
# RUN yarn add -g @angular/cli@7.3.9
|
||||
COPY . .
|
||||
RUN npm rebuild node-sass
|
||||
RUN npm run build-prod
|
||||
ENTRYPOINT [ "ng", "s", "--host", "0.0.0.0", "--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;"]
|
||||
RUN yarn run build-prod
|
||||
ENTRYPOINT [ "ng", "serve", "--port", "80" ]
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
FROM node:11.15.0 as builder
|
||||
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-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;"]
|
||||
+11
-16
@@ -1,19 +1,14 @@
|
||||
server {
|
||||
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;
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/javascript;
|
||||
gzip_proxied no-cache no-store private expired auth;
|
||||
gzip_min_length 1000;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
listen 80;
|
||||
server_name 0.0.0.0;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
Generated
-12862
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -60,6 +60,6 @@
|
||||
"protractor": "~5.4.2",
|
||||
"ts-node": "~8.0.3",
|
||||
"tslint": "~5.14.0",
|
||||
"typescript": "^3.2.4"
|
||||
"typescript": "3.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
+8957
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user