Compare commits

..
Author SHA1 Message Date
marc 949e2dcec3 better dockerfile 2022-09-15 17:11:06 +02:00
8 changed files with 915 additions and 2485 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
+22 -21
View File
@@ -1,41 +1,42 @@
version: "3.9"
version: '3'
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
restart: unless-stopped
env_file:
- .env
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: 'numeris'
volumes:
- mysql:/var/lib/mysql
- ./var/mysql:/var/lib/mysql
container_name: numeris_mysql
back:
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile
env_file:
- .env
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
depends_on:
- mysql
front:
build:
context: ./front
dockerfile: Dockerfile
depends_on:
- back
entrypoint: ng s --host 0.0.0.0
volumes:
mysql:
container_name: numeris_back
+2 -24
View File
@@ -1,25 +1,14 @@
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
@@ -36,15 +25,4 @@ services:
- mysql
depends_on:
- mysql
front:
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile
ports:
- 4200:4200
links:
- back
depends_on:
- back
container_name: numeris_back
+1 -5
View File
@@ -1,18 +1,14 @@
FROM node:11.15.0
RUN mkdir -p /home/numeris
WORKDIR /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