Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1ffa56be5 | ||
|
|
ba17666dbf | ||
|
|
bb74543041 | ||
|
|
f5fa47b0af | ||
|
|
eb1738c549 | ||
|
|
d4804bd214 | ||
|
|
5ff785add9 | ||
|
|
897880c9f0 | ||
|
|
be946356ae | ||
|
|
fea17b735c | ||
|
|
07dbb05443 | ||
|
|
d18074c556 | ||
|
|
3301654cb7 | ||
|
|
a98a4ca05a | ||
|
|
b317fd82b3 | ||
|
|
3b18e4dd36 | ||
|
|
6d40239a13 | ||
|
|
57fb4d7639 | ||
|
|
36ea133390 | ||
|
|
9f28d25eb7 | ||
|
|
739212ea0a | ||
|
|
c64058fff0 |
@@ -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
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Generated
+2344
-880
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,6 @@ services:
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin:latest
|
||||
container_name: numeris_phpmyadmin
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 3000:80
|
||||
@@ -14,15 +13,13 @@ services:
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
container_name: numeris_mysql
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./var/mysql:/var/lib/mysql
|
||||
- mysql:/var/lib/mysql
|
||||
|
||||
back:
|
||||
container_name: numeris_back
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: ./back
|
||||
@@ -33,12 +30,12 @@ services:
|
||||
- mysql
|
||||
|
||||
front:
|
||||
container_name: numeris_front
|
||||
build:
|
||||
context: ./front
|
||||
dockerfile: Dockerfile
|
||||
depends_on:
|
||||
- back
|
||||
entrypoint: ng s --host 0.0.0.0
|
||||
|
||||
volumes:
|
||||
mysql:
|
||||
|
||||
@@ -10,8 +10,6 @@ services:
|
||||
- mysql:db
|
||||
depends_on:
|
||||
- mysql
|
||||
volumes:
|
||||
- ./var/mysql_testing:/var/lib/mysql
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
@@ -45,7 +43,7 @@ services:
|
||||
context: ./front
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- 8000:80
|
||||
- 4200:4200
|
||||
links:
|
||||
- back
|
||||
depends_on:
|
||||
|
||||
+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