docker
This commit is contained in:
@@ -17,21 +17,18 @@ WORKDIR /usr/share/nginx/html
|
|||||||
COPY --from=builder /app .
|
COPY --from=builder /app .
|
||||||
|
|
||||||
# Copier une configuration nginx pour le SPA
|
# Copier une configuration nginx pour le SPA
|
||||||
RUN mkdir -p /etc/nginx/conf.d && \
|
COPY <<EOF /etc/nginx/conf.d/default.conf
|
||||||
cat > /etc/nginx/conf.d/default.conf << 'EOF'
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Cache les assets statiques
|
|
||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fallback pour le SPA
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri /index.html;
|
try_files $uri /index.html;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user