Skip to content

Commit

Permalink
Move Frontend deploy steps from Dockerfile to app
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Jun 11, 2024
1 parent 2045b49 commit 34f3d10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
*.md
LICENSE
.idea
.vscode
coverage
cypress
dist
Expand All @@ -10,3 +8,4 @@ e2e
migrations
output
tests
Dockerfile
5 changes: 2 additions & 3 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ FROM node:20.14.0-bullseye-slim AS build
# See .dockerignore for exclusions
WORKDIR /app
COPY . ./
RUN npm ci --ignore-scripts --no-update-notifier --omit=dev && \
npm run build
RUN npm run deploy

# Deploy using Caddy to host static files
FROM caddy:2.8.4-alpine
RUN apk add --no-cache ca-certificates

# Copy static files and run formatting
# Copy static files, verify Caddyfile formatting
COPY --from=build /app/dist /srv
COPY Caddyfile /etc/caddy/Caddyfile
RUN caddy fmt /etc/caddy/Caddyfile
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"clean": "rimraf ./node_modules/.vite",
"build:analyze": "vite build --mode analyze",
"build:clean": "rimraf dist",
"deploy": "npm ci --ignore-scripts --no-update-notifier --omit=dev && npm run build",
"preview": "vite preview",
"test:unit": "vitest --mode test",
"test:cov": "vitest run --mode test --coverage",
Expand Down

0 comments on commit 34f3d10

Please sign in to comment.