mirror of
https://github.com/AppFlowy-IO/AppFlowy-Web.git
synced 2026-03-13 10:00:26 +08:00
chore: add docker folder
This commit is contained in:
1
.github/workflows/web_docker.yml
vendored
1
.github/workflows/web_docker.yml
vendored
@@ -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:
|
||||
|
||||
1
.github/workflows/web_docker_manual.yml
vendored
1
.github/workflows/web_docker_manual.yml
vendored
@@ -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
|
||||
|
||||
|
||||
@@ -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
48
docker/nginx.conf
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user