Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c364757cf4 |
@@ -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
|
||||
+10
-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,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
|
||||
|
||||
@@ -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
|
||||
|
||||
Generated
+870
-2334
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -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,3 +1,4 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
Dockerfile
|
||||
|
||||
+8
-16
@@ -1,18 +1,10 @@
|
||||
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
|
||||
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 . /home/numeris
|
||||
|
||||
COPY . .
|
||||
RUN npm rebuild node-sass
|
||||
|
||||
WORKDIR /home/numeris
|
||||
RUN npm run build
|
||||
ENTRYPOINT [ "ng", "serve", "--configuration", "production", "--port", "80"]
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
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;"]
|
||||
@@ -0,0 +1,14 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Generated
-12862
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -60,6 +60,6 @@
|
||||
"protractor": "~5.4.2",
|
||||
"ts-node": "~8.0.3",
|
||||
"tslint": "~5.14.0",
|
||||
"typescript": "^3.2.4"
|
||||
"typescript": "3.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
+8957
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user