Compare commits

..
Author SHA1 Message Date
marc 09f6858326 external true 2022-10-03 20:23:36 +02:00
marc 6d3fc1b774 bye 2022-10-03 20:21:49 +02:00
marc 326cce6fd8 image 2022-10-03 20:18:46 +02:00
marc 1f9a0b1bb9 var run docker 2022-10-03 20:16:31 +02:00
marc 4d6fe9941b dash 2022-10-03 19:45:44 +02:00
marc 418de3d52d fix conflict 2022-10-03 19:40:51 +02:00
marc b7c51c7f3c production 2022-09-21 16:48:27 +02:00
marc 6c60e3792c image names even though they point towards nothing 2022-09-20 16:11:03 +02:00
marc 140fb1d7d8 3.9 2022-09-20 15:44:48 +02:00
4 changed files with 58 additions and 40 deletions
+37 -3
View File
@@ -7,15 +7,21 @@ services:
restart: unless-stopped
ports:
- 3000:80
links:
- 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:
@@ -26,7 +32,10 @@ services:
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile
dockerfile: Dockerfile.production
networks:
- caddy
- mysql
env_file:
- .env
depends_on:
@@ -37,8 +46,33 @@ services:
build:
context: ./front
dockerfile: Dockerfile
networks:
- caddy
depends_on:
- back
labels:
caddy: numeris-isep.fr
caddy.reverse_proxy: "{{upstreams 4200}}"
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
restart: unless-stopped
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:
volumes:
mysql:
+4 -2
View File
@@ -1,4 +1,4 @@
version: '3'
version: "3.9"
services:
phpmyadmin:
@@ -21,6 +21,7 @@ services:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
back:
image: numeris-back
container_name: numeris_back
build:
context: ./back
@@ -40,12 +41,13 @@ services:
- mysql
front:
image: numeris-front
container_name: numeris_front
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
-19
View File
@@ -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;
}
}