Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dc06d439d |
+1
-2
@@ -4,7 +4,6 @@
|
||||
.vscode
|
||||
.DS_Store
|
||||
docker-compose*.yml
|
||||
.env*
|
||||
|
||||
# Back
|
||||
back/.DS_Store
|
||||
@@ -18,4 +17,4 @@ var
|
||||
# Front
|
||||
front/.DS_Store
|
||||
front/node_modules/
|
||||
front/dist/
|
||||
front/dist/
|
||||
@@ -14,7 +14,8 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-front:
|
||||
name: Build front
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -31,10 +32,58 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
- 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
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: back
|
||||
dockerfile: Dockerfile.production
|
||||
push: true
|
||||
tags: marcpartensky/numeris-back:latest
|
||||
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
|
||||
|
||||
+8
-7
@@ -1,4 +1,6 @@
|
||||
FROM php:7.4-apache
|
||||
FROM php:7.2-apache
|
||||
|
||||
RUN mkdir -p /home/numeris
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update && apt-get install -y \
|
||||
@@ -6,9 +8,7 @@ RUN apt-get update && apt-get install -y \
|
||||
zip \
|
||||
unzip \
|
||||
nano \
|
||||
libpng-dev \
|
||||
libzip-dev
|
||||
|
||||
libpng-dev
|
||||
|
||||
# Install the PHP mcrypt pdo_mysql extension
|
||||
RUN docker-php-ext-install pdo_mysql gd zip
|
||||
@@ -21,17 +21,18 @@ RUN a2dissite 000-default.conf && a2ensite numeris.conf && a2enmod rewrite && se
|
||||
# Enable php conf
|
||||
COPY docker/php/php.ini /usr/local/etc/php/conf.d/default.ini
|
||||
|
||||
WORKDIR /home/numeris
|
||||
COPY . .
|
||||
COPY . /home/numeris
|
||||
|
||||
# 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/
|
||||
|
||||
ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
|
||||
WORKDIR /home/numeris
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
FROM php:7.4-apache
|
||||
FROM php:7.2-apache
|
||||
|
||||
RUN mkdir -p /home/numeris
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update && apt-get install -y \
|
||||
@@ -6,8 +8,7 @@ RUN apt-get update && apt-get install -y \
|
||||
zip \
|
||||
unzip \
|
||||
nano \
|
||||
libpng-dev \
|
||||
libzip-dev
|
||||
libpng-dev
|
||||
|
||||
# Install the PHP mcrypt pdo_mysql extension
|
||||
RUN docker-php-ext-install pdo_mysql gd zip
|
||||
@@ -19,20 +20,21 @@ RUN a2dissite 000-default.conf && a2ensite numeris.conf && a2enmod rewrite && se
|
||||
# Enable php conf
|
||||
COPY docker/php/php.ini /usr/local/etc/php/conf.d/default.ini
|
||||
|
||||
WORKDIR /home/numeris
|
||||
COPY . .
|
||||
COPY . /home/numeris
|
||||
|
||||
### 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" ]
|
||||
|
||||
Generated
+870
-2334
File diff suppressed because it is too large
Load Diff
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
php artisan key:generate --force
|
||||
php artisan jwt:secret --force
|
||||
php artisan migrate:refresh --seed --force
|
||||
|
||||
docker-php-entrypoint
|
||||
apache2-foreground
|
||||
+23
-100
@@ -1,119 +1,42 @@
|
||||
version: "3.9"
|
||||
version: '3'
|
||||
services:
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin:latest
|
||||
container_name: numeris_phpmyadmin
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 3000:80
|
||||
links:
|
||||
- mysql:db
|
||||
depends_on:
|
||||
- mysql
|
||||
networks:
|
||||
- traefik
|
||||
- mysql
|
||||
labels:
|
||||
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
|
||||
container_name: numeris_phpmyadmin
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
container_name: numeris_mysql
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- mysql
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
MYSQL_DATABASE: 'numeris'
|
||||
volumes:
|
||||
- ./var/mysql:/var/lib/mysql
|
||||
container_name: numeris_mysql
|
||||
|
||||
back:
|
||||
container_name: numeris_back
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: ./back
|
||||
dockerfile: Dockerfile.production
|
||||
networks:
|
||||
- traefik
|
||||
- mysql
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- mysql
|
||||
labels:
|
||||
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:
|
||||
container_name: numeris_front
|
||||
build:
|
||||
context: ./front
|
||||
dockerfile: Dockerfile
|
||||
networks:
|
||||
- traefik
|
||||
depends_on:
|
||||
- back
|
||||
labels:
|
||||
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
|
||||
|
||||
traefik:
|
||||
image: traefik
|
||||
restart: unless-stopped
|
||||
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
|
||||
environment:
|
||||
APP_ENV: production
|
||||
APP_DEBUG: 'false'
|
||||
DB_CONNECTION: mysql
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_PORT: ${DB_PORT}
|
||||
DB_DATABASE: ${DB_DATABASE}
|
||||
DB_USERNAME: ${DB_USERNAME}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
networks:
|
||||
- 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:
|
||||
traefik:
|
||||
mysql:
|
||||
|
||||
volumes:
|
||||
traefik_letsencrypt:
|
||||
mysql:
|
||||
- ${BACK_PORT}:80
|
||||
links:
|
||||
- mysql
|
||||
depends_on:
|
||||
- mysql
|
||||
container_name: numeris_back
|
||||
|
||||
@@ -1,31 +1,14 @@
|
||||
version: "3.9"
|
||||
version: '3'
|
||||
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'
|
||||
container_name: numeris_mysql
|
||||
|
||||
back:
|
||||
image: numeris-back
|
||||
container_name: numeris_back
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: ./back
|
||||
dockerfile: Dockerfile
|
||||
@@ -42,17 +25,4 @@ services:
|
||||
- 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
|
||||
container_name: numeris_back
|
||||
|
||||
+17
-16
@@ -1,17 +1,18 @@
|
||||
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 . .
|
||||
RUN npm rebuild node-sass
|
||||
RUN npm run build-prod
|
||||
ENTRYPOINT [ "ng", "s", "--host", "0.0.0.0" ]
|
||||
FROM node:11.15.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 ["nginx", "-g", "daemon off;"]
|
||||
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
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
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;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user