Skip to content

Commit

Permalink
update nginx config (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam authored Jul 5, 2023
1 parent 1259a87 commit 3d554f9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN pnpm fetch
ADD . ./
RUN pnpm install --offline

ARG VITE_APP_GIT_SHA=production
ARG VITE_APP_GIT_SHA=unknown
ARG SENTRY_AUTH_TOKEN
ENV VITE_APP_GIT_SHA $VITE_APP_GIT_SHA
ENV SENTRY_AUTH_TOKEN $SENTRY_AUTH_TOKEN
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.2'

services:
connect:
image: connect
build: .
ports:
- "3000:80"
environment:
COMMA_URL_ROOT: https://api.comma.ai/
ATHENA_URL_ROOT: https://athena.comma.ai/
BILLING_URL_ROOT: https://billing.comma.ai/
USERADMIN_URL_ROOT: https://useradmin.comma.ai/
SENTRY_ENV: connect-development
21 changes: 16 additions & 5 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,34 @@ server {
server_name localhost;

gzip on;
gzip_types text/html text/plain text/css text/xml text/javascript application/javascript application/x-javascript;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/x-javascript;
gzip_min_length 1024;
gzip_vary on;

root /usr/share/nginx/html;

etag off;

location /index.html {
add_header Cache-Control 'no-store, no-cache';
if_modified_since off;
expires off;
}

location /service-worker.js {
add_header Cache-Control 'no-store, no-cache';
if_modified_since off;
expires off;
etag off;
}

try_files $uri $uri/ =404;
location /assets/ {
expires 1y;
add_header Cache-Control 'public';
}

location /static/ {
try_files $uri $uri/ =404;
location /images/ {
expires 7d;
add_header Cache-Control 'public';
}

location / {
Expand Down

0 comments on commit 3d554f9

Please sign in to comment.