Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to caddy #80

Merged
merged 3 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
admin off
auto_https off
persist_config off
}

:80

@tracingEnabled expression {env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT} != ""
root * /usr/share/caddy
file_server
try_files {path} /
handle @tracingEnabled {
tracing
}
23 changes: 12 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
FROM node:16.14.2 as ci-stage
FROM node:16.14.2 AS ci-stage
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY ./ .
RUN --mount=type=cache,target=/root/.npm npm ci
COPY ./src/ ./src/
COPY ./.storybook/ ./.storybook/
COPY *.js *.json ./
RUN ls ./

FROM ci-stage as build-stage
FROM ci-stage AS build-stage
RUN npm run build

FROM ci-stage as build-storybook
FROM ci-stage AS build-storybook
RUN npm run build-storybook

FROM nginx:alpine as production-stage
RUN mkdir /app
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build-stage /app/dist /app
COPY --from=build-storybook /app/storybook-static /app/storybook

FROM caddy:alpine
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=build-stage /app/dist/ /usr/share/caddy/
COPY --from=build-storybook /app/storybook-static/ /usr/share/caddy/storybook/
29 changes: 0 additions & 29 deletions conf.d/default.conf

This file was deleted.

30 changes: 0 additions & 30 deletions nginx.conf

This file was deleted.

Loading