chore: add docker folder

This commit is contained in:
Nathan
2025-07-04 16:02:39 +08:00
parent 1d6347c92e
commit f2cd859059
4 changed files with 54 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ jobs:
${{ env.IMAGE_NAME }}:latest-${{ env.PLATFORM_PAIR }}
build-args: VERSION=${{ github.event.inputs.version }}
context: .
file: docker/Dockerfile
provenance: false
push: true
merge:

View File

@@ -85,6 +85,7 @@ jobs:
${{ env.IMAGE_NAME }}:test-latest-${{ env.PLATFORM_PAIR }}
build-args: VERSION=${{ github.event.inputs.version }}
context: .
file: docker/Dockerfile
provenance: false
push: true

View File

@@ -14,4 +14,7 @@ RUN sed -i 's|https://test.appflowy.cloud||g' src/components/main/app.hooks.ts
RUN pnpm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html/
COPY --from=builder /app/dist /usr/share/nginx/html/
# Copy nginx.conf from docker folder
COPY docker/nginx.conf /etc/nginx/nginx.conf

48
docker/nginx.conf Normal file
View File

@@ -0,0 +1,48 @@
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# Basic optimization
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
# GZIP compression
gzip on;
gzip_vary on;
gzip_min_length 1k;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
# Static files cache
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
}
# SPA routing
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Deny access to non public path
location ~ /\. {
deny all;
}
}
}