Compare commits

..
Author SHA1 Message Date
marc 09f6858326 external true 2022-10-03 20:23:36 +02:00
marc 6d3fc1b774 bye 2022-10-03 20:21:49 +02:00
marc 326cce6fd8 image 2022-10-03 20:18:46 +02:00
marc 1f9a0b1bb9 var run docker 2022-10-03 20:16:31 +02:00
marc 4d6fe9941b dash 2022-10-03 19:45:44 +02:00
marc 418de3d52d fix conflict 2022-10-03 19:40:51 +02:00
marc b7c51c7f3c production 2022-09-21 16:48:27 +02:00
marc 6c60e3792c image names even though they point towards nothing 2022-09-20 16:11:03 +02:00
marc 140fb1d7d8 3.9 2022-09-20 15:44:48 +02:00
marc b54c69ae4c names are back 2022-09-20 15:18:09 +02:00
marc ce259181b9 mysql_testing 2022-09-20 14:38:33 +02:00
marc 77ca1911ed bind mount is back 2022-09-20 14:36:31 +02:00
7 changed files with 937 additions and 2441 deletions
-48
View File
@@ -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
-40
View File
@@ -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
+10 -7
View File
@@ -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,15 +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 /opt/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 /opt/numeris
RUN chown -R www-data:www-data /home/numeris
RUN chown -R www-data:www-data /var/log/apache2/
WORKDIR /home/numeris
+10 -6
View File
@@ -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,18 +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 /opt/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 /opt/numeris
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
+870 -2334
View File
File diff suppressed because it is too large Load Diff
+42 -5
View File
@@ -3,39 +3,76 @@ 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}}"
mysql:
image: mysql:5.7
container_name: numeris_mysql
restart: unless-stopped
networks:
- mysql
env_file:
- .env
volumes:
- mysql:/var/lib/mysql
- ./var/mysql:/var/lib/mysql
back:
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile
dockerfile: Dockerfile.production
networks:
- caddy
- mysql
env_file:
- .env
depends_on:
- mysql
front:
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile
networks:
- caddy
depends_on:
- back
entrypoint: ng s --host 0.0.0.0
labels:
caddy: numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 4200}}"
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
restart: unless-stopped
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:
mysql:
+5 -1
View File
@@ -1,4 +1,4 @@
version: '3'
version: "3.9"
services:
phpmyadmin:
@@ -10,6 +10,8 @@ services:
- mysql:db
depends_on:
- mysql
volumes:
- ./var/mysql_testing:/var/lib/mysql
mysql:
image: mysql:5.7
@@ -19,6 +21,7 @@ services:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
back:
image: numeris-back
container_name: numeris_back
build:
context: ./back
@@ -38,6 +41,7 @@ services:
- mysql
front:
image: numeris-front
container_name: numeris_front
build:
context: ./front