Compare commits

..
8 changed files with 28 additions and 121 deletions
+1 -2
View File
@@ -4,7 +4,6 @@
.vscode
.DS_Store
docker-compose*.yml
.env*
# Back
back/.DS_Store
@@ -18,4 +17,4 @@ var
# Front
front/.DS_Store
front/node_modules/
front/dist/
front/dist/
+2 -4
View File
@@ -21,7 +21,7 @@ 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
WORKDIR /opt/numeris
COPY . .
# Composer install
@@ -31,7 +31,5 @@ RUN composer install --no-interaction
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/
ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
+2 -4
View File
@@ -19,7 +19,7 @@ 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
WORKDIR /opt/numeris
COPY . .
### Back config ###
@@ -29,10 +29,8 @@ RUN composer install --optimize-autoloader --no-dev --no-interaction
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/
RUN php artisan config:cache
RUN php artisan route:cache
ENTRYPOINT [ "/home/numeris/entrypoint.sh" ]
-8
View File
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
php artisan key:generate --force
php artisan jwt:secret --force
php artisan migrate:refresh --seed --force
docker-php-entrypoint
apache2-foreground
+4 -53
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,32 @@ 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:
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile.production
networks:
- caddy
- mysql
dockerfile: Dockerfile
env_file:
- .env
depends_on:
- mysql
networks:
- caddy
labels:
caddy: api.numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.reverse_proxy.header_down: -Access-Control-Allow-Origin
- mysql
front:
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile
networks:
- caddy
depends_on:
- back
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:
entrypoint: ng s --host 0.0.0.0
volumes:
caddy_data:
mysql:
+2 -10
View File
@@ -1,31 +1,25 @@
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'
back:
image: numeris-back
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile
@@ -44,14 +38,12 @@ services:
- mysql
front:
image: numeris-front
container_name: numeris_front
restart: unless-stopped
build:
context: ./front
dockerfile: Dockerfile
ports:
- 8000:80
- 4200:4200
links:
- back
depends_on:
+17 -16
View File
@@ -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
-24
View File
@@ -1,24 +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;
proxy_pass http://api.numeris-isep.fr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}