Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
630aab60db |
+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/
|
||||
@@ -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
|
||||
+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
Executable → Regular
+17
-7
@@ -1,8 +1,18 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
php artisan key:generate --force
|
||||
php artisan jwt:secret --force
|
||||
php artisan migrate:refresh --seed --force
|
||||
|
||||
docker-php-entrypoint
|
||||
apache2-foreground
|
||||
php artisan tinker
|
||||
php artisan migrate:refresh --seed
|
||||
php artisan migrate
|
||||
php artisan migrate --force
|
||||
php artisan migrate:refresh
|
||||
php artisan migrate:rollback
|
||||
php artisan db:seed
|
||||
vendor/bin/phpunit
|
||||
# less +G storage/logs/laravel.log
|
||||
php artisan config:clear
|
||||
php artisan cache:clear
|
||||
php artisan route:clear
|
||||
xhp artisan route:cache
|
||||
php artisan config:cache
|
||||
php artisan key:generate
|
||||
php artisan jwt:secret
|
||||
|
||||
@@ -1,92 +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:
|
||||
- caddy
|
||||
- mysql
|
||||
labels:
|
||||
caddy: phpmyadmin.numeris-isep.fr
|
||||
caddy.reverse_proxy: "{{upstreams 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:
|
||||
image: numerisisep/numeris-back
|
||||
container_name: numeris_back
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: ./back
|
||||
dockerfile: Dockerfile.production
|
||||
networks:
|
||||
- caddy
|
||||
- mysql
|
||||
env_file:
|
||||
- .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-back
|
||||
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
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
CADDY_INGRESS_NETWORKS: caddy
|
||||
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"
|
||||
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:
|
||||
- ${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: numerisisep/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: numerisisep/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,24 +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;
|
||||
proxy_pass http://api.numeris-isep.fr;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user