mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-05-09 23:55:32 +00:00
Compare commits
13 Commits
feat/caddy
...
feat/vite
| Author | SHA1 | Date | |
|---|---|---|---|
| 59bca43c62 | |||
| 3f28988ef8 | |||
| 205d7e1ed5 | |||
| 91c81cafce | |||
| 76eca1b3b7 | |||
| 2883760362 | |||
| c5c1cf1c8d | |||
| b30c068f9e | |||
| 4b68a4ad7c | |||
| 3e5267933c | |||
| e427d9db26 | |||
| bcf5b7d890 | |||
| 037857cd51 |
31
Caddyfile
31
Caddyfile
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
# Disable automatic HTTPS
|
|
||||||
auto_https off
|
|
||||||
}
|
|
||||||
|
|
||||||
:8080 {
|
|
||||||
root * {$DIST_PATH:/usr/share/caddy}
|
|
||||||
|
|
||||||
file_server
|
|
||||||
|
|
||||||
encode gzip zstd
|
|
||||||
|
|
||||||
try_files {path} {path}/ /index.html
|
|
||||||
|
|
||||||
# Cache favicons aggressively
|
|
||||||
@favicons path /favicons/*
|
|
||||||
header @favicons Cache-Control "public, max-age=31536000, immutable"
|
|
||||||
|
|
||||||
# Cache static assets based on MIME type
|
|
||||||
@static {
|
|
||||||
header Content-Type application/javascript*
|
|
||||||
header Content-Type text/css*
|
|
||||||
header Content-Type image/*
|
|
||||||
header Content-Type font/*
|
|
||||||
header Content-Type application/font-*
|
|
||||||
header Content-Type application/woff*
|
|
||||||
header Content-Type application/json*
|
|
||||||
}
|
|
||||||
|
|
||||||
header @static Cache-Control "public, max-age=2592000, immutable"
|
|
||||||
}
|
|
||||||
21
Dockerfile
21
Dockerfile
@@ -23,16 +23,21 @@ ENV VITE_ELASTIC_API_KEY=$ELASTIC_API_KEY
|
|||||||
|
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
FROM caddy:2.11-alpine
|
FROM nginx:1.29.5
|
||||||
|
|
||||||
COPY Caddyfile /etc/caddy/Caddyfile
|
|
||||||
|
|
||||||
# Copy static files
|
|
||||||
COPY public /usr/share/caddy
|
|
||||||
|
|
||||||
# Copy the static build from the previous stage
|
# Copy the static build from the previous stage
|
||||||
COPY --from=build /app/dist /usr/share/caddy
|
COPY index.html /usr/share/nginx/html
|
||||||
|
COPY public/ /usr/share/nginx/html
|
||||||
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
EXPOSE 8080
|
# Copy nginx config file
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf.template
|
||||||
|
|
||||||
|
# Manual entrypoint after nginx substring
|
||||||
|
COPY docker-entrypoint.sh /docker-entrypoint.d/05-docker-entrypoint.sh
|
||||||
|
|
||||||
|
RUN chmod +x /docker-entrypoint.d/05-docker-entrypoint.sh
|
||||||
|
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source https://github.com/kevinmidboe/seasoned
|
LABEL org.opencontainers.image.source https://github.com/kevinmidboe/seasoned
|
||||||
|
|||||||
9
docker-entrypoint.sh
Normal file
9
docker-entrypoint.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
export SEASONED_API=${SEASONED_API:-http://localhost:31459}
|
||||||
|
export SEASONED_DOMAIN=${SEASONED_DOMAIN:-localhost}
|
||||||
|
|
||||||
|
envsubst '$SEASONED_API,$SEASONED_DOMAIN' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
30
nginx.conf
Normal file
30
nginx.conf
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
server {
|
||||||
|
listen 5000 default_server;
|
||||||
|
listen [::]:5000 default_server;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_types application/javascript;
|
||||||
|
gzip_min_length 1000;
|
||||||
|
gzip_static on;
|
||||||
|
|
||||||
|
location /favicons {
|
||||||
|
autoindex on;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /dist {
|
||||||
|
add_header Content-Type application/javascript;
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api {
|
||||||
|
proxy_pass $SEASONED_API;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
index index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user