Compare commits

..
Author SHA1 Message Date
marc 5e9a7ccf82 needs
Docker build test / build-back (push) Canceled after 0s
Docker build test / build-front (push) Canceled after 0s
2022-10-17 06:40:23 +02:00
marc 91fa5c4f5a pull and recreate job 2022-10-17 06:38:46 +02:00
marc 4a3ffdfc0d fix dumb mistake 2022-10-17 06:31:44 +02:00
marc 02ff859c54 build front and back at the same time 2022-10-17 06:31:11 +02:00
marc 49964d06b3 build front then back 2022-10-12 05:43:40 +02:00
marc d4804bd214 touch .env 2022-09-16 19:47:47 +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 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 8f69143715 3.9 2022-09-16 18:43:11 +02:00
17 changed files with 13781 additions and 11479 deletions
+1 -3
View File
@@ -4,8 +4,6 @@
.vscode
.DS_Store
docker-compose*.yml
.env
.env.template
# Back
back/.DS_Store
@@ -19,4 +17,4 @@ var
# Front
front/.DS_Store
front/node_modules/
front/dist/
front/dist/
-2
View File
@@ -2,5 +2,3 @@
vendor
public/storage
public/build
.env
.env.template
+8 -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,17 +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 /home/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 /home/numeris
RUN chown -R www-data:www-data /var/log/apache2/
ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
WORKDIR /home/numeris
+10 -12
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
@@ -15,28 +16,25 @@ RUN docker-php-ext-install pdo_mysql gd zip
COPY --from=composer /usr/bin/composer /usr/bin/composer
# Enable apache conf
COPY docker/apache/numeris.conf /etc/apache2/sites-available/numeris.conf
RUN a2dissite 000-default.conf && \
a2ensite numeris.conf && \
a2enmod headers && \
a2enmod rewrite && \
service apache2 restart
RUN a2dissite 000-default.conf && a2ensite numeris.conf && a2enmod rewrite && service apache2 restart
# Enable php conf
COPY docker/php/php.ini /usr/local/etc/php/conf.d/default.ini
WORKDIR /home/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 /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
ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
+3 -11
View File
@@ -1,11 +1,7 @@
{
"name": "2seg/numeris-v2",
"description": "Home of the new website of Numéris.",
"keywords": [
"Numéris",
"association",
"website"
],
"keywords": ["Numéris", "association", "website"],
"license": "MIT",
"type": "project",
"authors": [
@@ -18,11 +14,6 @@
"name": "MinhNam Nguyen",
"email": "nguyen.minhnam@hotmail.fr",
"role": "Developer"
},
{
"name": "Marc Partensky",
"email": "marc@marcpartensky.com",
"role": "Developer"
}
],
"require": {
@@ -60,7 +51,8 @@
},
"extra": {
"laravel": {
"dont-discover": []
"dont-discover": [
]
}
},
"scripts": {
+870 -2334
View File
File diff suppressed because it is too large Load Diff
+2 -6
View File
@@ -6,14 +6,10 @@
# Force HTTPS when X-Forwarded-Proto is passed as HTTPS
# Useful when the reverse proxy is in HTTPS
SetEnvIf x-forwarded-proto https HTTPS=on
# Header set Access-Control-Allow-Origin "*"
# Header set Access-Control-Allow-Origin "numeris-isep.fr"
Header set Access-Control-Allow-Origin "https://numeris-isep.fr"
AllowOverride All
Require all granted
</Directory>
LogLevel info
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
ErrorLog /var/log/apache2/numeris-error.log
CustomLog /var/log/apache2/numeris-access.log combined
</VirtualHost>
-12
View File
@@ -1,12 +0,0 @@
#!/usr/bin/env sh
php artisan key:generate
# php artisan key:generate --force
php artisan jwt:secret
# php artisan jwt:secret --force
# php artisan cache:clear
php artisan config:clear
php artisan migrate:refresh
docker-php-entrypoint
apache2-foreground
+5 -61
View File
@@ -3,7 +3,6 @@ services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
restart: unless-stopped
ports:
- 3000:80
@@ -11,80 +10,25 @@ services:
- 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:
- ./var/mysql:/var/lib/mysql
- mysql:/var/lib/mysql
back:
image: numerisisep/numeris-back
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile.production
networks:
- caddy
- mysql
dockerfile: Dockerfile
env_file:
- .env
volumes:
- .env:/home/numeris/.env
links:
- mysql
depends_on:
- mysql
labels:
caddy: api.numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
# caddy.reverse_proxy.header_down: -Access-Control-Allow-Origin
front:
image: numerisisep/numeris-front
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile.production
networks:
- caddy
labels:
caddy: numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
restart: unless-stopped
environment:
CADDY_INGRESS_NETWORKS: caddy
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:
- mysql
volumes:
caddy_data:
mysql:
+3 -33
View File
@@ -1,31 +1,14 @@
version: "3.9"
version: '3'
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
restart: unless-stopped
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
volumes:
- ./var/mysql_testing:/var/lib/mysql
mysql:
image: mysql:5.7
container_name: numeris_mysql
restart: unless-stopped
environment:
MYSQL_DATABASE: 'numeris_testing'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
container_name: numeris_mysql
back:
image: numerisisep/numeris-back
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile
@@ -42,17 +25,4 @@ services:
- mysql
depends_on:
- mysql
front:
image: numerisisep/numeris-front
container_name: numeris_front
restart: unless-stopped
build:
context: ./front
dockerfile: Dockerfile
ports:
- 8000:80
links:
- back
depends_on:
- back
container_name: numeris_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