Skip to content

Commit 2065805

Browse files
committed
update bonus heroku
1 parent 8f8f63d commit 2065805

81 files changed

Lines changed: 8582 additions & 4519 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.github
2+
node_modules
3+
dist
4+
.editorconfig
5+
.gitignore
6+
.prettierrc
7+
.env.development
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM node:20-alpine AS base
2+
RUN mkdir -p /usr/app
3+
WORKDIR /usr/app
4+
5+
# Prepare static files
6+
FROM base AS build-front
7+
COPY ./ ./
8+
RUN npm ci
9+
RUN npm run build
10+
11+
# Release
12+
FROM base AS release
13+
ENV STATIC_FILES_PATH=./public
14+
COPY --from=build-front /usr/app/dist $STATIC_FILES_PATH
15+
COPY ./server/package.json ./
16+
COPY ./server/package-lock.json ./
17+
COPY ./server/index.js ./
18+
RUN npm ci --omit=dev
19+
20+
ENV PORT=8080
21+
CMD node index.js
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vitest/globals" />
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig } from 'vitest/config';
2+
import { fileURLToPath } from 'node:url';
3+
4+
export default defineConfig({
5+
test: {
6+
globals: true,
7+
restoreMocks: true,
8+
environment: 'jsdom',
9+
setupFiles: ['./config/test/setup.ts'],
10+
alias: {
11+
'@': fileURLToPath(new URL('../../src', import.meta.url)),
12+
},
13+
},
14+
});

07-cloud/99-bonus/02-heroku-front/config/test/jest.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

07-cloud/99-bonus/02-heroku-front/config/test/setup-after.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@testing-library/jest-dom/vitest';

0 commit comments

Comments
 (0)