replace shared volume between the inventaire and nginx services by a multi-stage copy
See https://docs.docker.com/build/building/multi-stage/#use-an-external-image-as-a-stage The shared volume was making updates complicated, as the persisted volume data would not be overriden by the new container
This commit is contained in:
@@ -10,7 +10,6 @@ services:
|
|||||||
- couchdb
|
- couchdb
|
||||||
- elasticsearch
|
- elasticsearch
|
||||||
volumes:
|
volumes:
|
||||||
- inventaire-server:/opt/inventaire
|
|
||||||
# The following paths are outside /opt/inventaire so that the inventaire-server volume can be removed
|
# The following paths are outside /opt/inventaire so that the inventaire-server volume can be removed
|
||||||
# (as required when updating the server and client) without loosing their data
|
# (as required when updating the server and client) without loosing their data
|
||||||
- inventaire-leveldb:/opt/inventaire_leveldb
|
- inventaire-leveldb:/opt/inventaire_leveldb
|
||||||
@@ -68,7 +67,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./nginx/templates:/etc/nginx/templates/
|
- ./nginx/templates:/etc/nginx/templates/
|
||||||
- ./nginx/snippets:/etc/nginx/snippets
|
- ./nginx/snippets:/etc/nginx/snippets
|
||||||
- inventaire-server:/opt/inventaire
|
|
||||||
- certbot-www:/var/www/html
|
- certbot-www:/var/www/html
|
||||||
- ./certbot/conf:/etc/letsencrypt
|
- ./certbot/conf:/etc/letsencrypt
|
||||||
- nginx-cache:/tmp/nginx
|
- nginx-cache:/tmp/nginx
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
FROM nginx
|
FROM nginx:1.28
|
||||||
|
|
||||||
RUN [ ! -f /etc/nginx/dhparam.pem ] && openssl dhparam -out /etc/nginx/dhparam.pem 2048
|
RUN [ ! -f /etc/nginx/dhparam.pem ] && openssl dhparam -out /etc/nginx/dhparam.pem 2048
|
||||||
|
|
||||||
RUN mkdir -p /tmp/nginx/tmp /tmp/nginx/resize/img/users /tmp/nginx/resize/img/groups /tmp/nginx/resize/img/entities /tmp/nginx/resize/img/remote /tmp/nginx/resize/img/assets && chown -R nginx:nginx /tmp/nginx
|
RUN mkdir -p /tmp/nginx/tmp /tmp/nginx/resize/img/users /tmp/nginx/resize/img/groups /tmp/nginx/resize/img/entities /tmp/nginx/resize/img/remote /tmp/nginx/resize/img/assets /var/cache/nginx/client_temp /opt/inventaire/client && chown -R nginx:nginx /tmp/nginx /opt
|
||||||
|
|
||||||
|
# See https://docs.docker.com/build/building/multi-stage/
|
||||||
|
COPY --from=inventaire/inventaire:latest /opt/inventaire/client /opt/inventaire/client
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ server {
|
|||||||
proxy_pass http://inv;
|
proxy_pass http://inv;
|
||||||
}
|
}
|
||||||
|
|
||||||
root /opt/inventaire/client;
|
root /opt/inventaire/client;
|
||||||
location /public {
|
location /public {
|
||||||
include /etc/nginx/snippets/security_headers.conf;
|
include /etc/nginx/snippets/security_headers.conf;
|
||||||
limit_except GET {
|
limit_except GET {
|
||||||
|
|||||||
Reference in New Issue
Block a user