Compare commits

..
Author SHA1 Message Date
marc f1ffa56be5 Merge branch 'docker-compose' into php7.4+github-action+docker-compose
Docker build test / build-back (push) Canceled after 0s
Docker build test / build-front (push) Canceled after 0s
2022-09-19 10:32:15 +02:00
marc 5e3dfec004 phpmyadmin might come in handy 2022-09-19 10:32:09 +02:00
marc ba17666dbf Merge branch 'docker-compose' into php7.4+github-action+docker-compose 2022-09-19 10:28:16 +02:00
marc b834f1d27b fix names 2022-09-19 10:27:59 +02:00
marc bb74543041 Merge branch 'docker-compose' into php7.4+github-action+docker-compose 2022-09-17 17:51:48 +02:00
marc 3a374a10bc front too 2022-09-17 17:51:40 +02:00
marc f5fa47b0af Merge branch 'docker-compose' into php7.4+github-action+docker-compose 2022-09-16 19:54:34 +02:00
marc 0378a0a224 front too 2022-09-16 19:54:08 +02:00
marc eb1738c549 Merge branch 'github-action' into php7.4+github-action 2022-09-16 19:48:15 +02:00
marc d4804bd214 touch .env 2022-09-16 19:47:47 +02:00
marc 5ff785add9 Merge branch 'github-action' into php7.4+github-action 2022-09-16 19:46:30 +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
14 changed files with 15369 additions and 9922 deletions
+48
View File
@@ -0,0 +1,48 @@
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
+40
View File
@@ -0,0 +1,40 @@
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
+7 -10
View File
@@ -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
@@ -21,18 +21,15 @@ 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
COPY . /home/numeris
WORKDIR /opt/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 /opt/numeris
RUN chown -R www-data:www-data /var/log/apache2/
WORKDIR /home/numeris
+6 -10
View File
@@ -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
@@ -20,21 +19,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
COPY . /home/numeris
WORKDIR /opt/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 /opt/numeris
RUN chown -R www-data:www-data /var/log/apache2/
WORKDIR /home/numeris
RUN php artisan config:cache
RUN php artisan route:cache
+2344 -880
View File
File diff suppressed because it is too large Load Diff
+21 -22
View File
@@ -1,42 +1,41 @@
version: '3'
version: "3.9"
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
restart: unless-stopped
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
container_name: numeris_phpmyadmin
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: 'numeris'
restart: unless-stopped
env_file:
- .env
volumes:
- ./var/mysql:/var/lib/mysql
container_name: numeris_mysql
- mysql:/var/lib/mysql
back:
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile.production
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:
- ${BACK_PORT}:80
links:
- mysql
dockerfile: Dockerfile
env_file:
- .env
depends_on:
- mysql
container_name: numeris_back
front:
build:
context: ./front
dockerfile: Dockerfile
depends_on:
- back
entrypoint: ng s --host 0.0.0.0
volumes:
mysql:
+24 -2
View File
@@ -1,14 +1,25 @@
version: '3'
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
mysql:
image: mysql:5.7
container_name: numeris_mysql
environment:
MYSQL_DATABASE: 'numeris_testing'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
container_name: numeris_mysql
back:
container_name: numeris_back
build:
context: ./back
dockerfile: Dockerfile
@@ -25,4 +36,15 @@ services:
- mysql
depends_on:
- mysql
container_name: numeris_back
front:
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile
ports:
- 4200:4200
links:
- back
depends_on:
- back
-1
View File
@@ -1,4 +1,3 @@
.DS_Store
node_modules/
dist/
Dockerfile
+16 -8
View File
@@ -1,10 +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
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 . .
COPY . /home/numeris
RUN npm rebuild node-sass
RUN npm run build
ENTRYPOINT [ "ng", "serve", "--configuration", "production", "--port", "80"]
WORKDIR /home/numeris
-17
View File
@@ -1,17 +0,0 @@
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;"]
-14
View File
@@ -1,14 +0,0 @@
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;
}
}
+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