-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Dockerfiles are now based on using `pnpm` and `nginx` - Helper Makefile for easier running commands - Dockerfile for `frontend-design-poc` - Dockerfile for `storybook` - Update Dockerfile for `bff-frontend-poc` - Update Dockerfile for `bff` Future TODO: - Fix Dockerfile setup for the `bff`, it currently doesn't start - Adapt `docker-compose.yml` file - Setup traefik in `docker-compose.yml` Relates to #180
- Loading branch information
Showing
13 changed files
with
115 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
storybook-static | ||
build | ||
.git | ||
.gitignore | ||
*.md | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
typecheck: ## Runs `pnpm turbo typecheck` | ||
pnpm turbo typecheck | ||
|
||
lint: ## Runs `pnpm turbo lint` | ||
pnpm turbo lint | ||
|
||
test: ## Runs `pndpm turbo test` | ||
pnpm turbo test | ||
|
||
build: ## Runs `pnpm turbo build` | ||
pnpm turbo build | ||
|
||
build-docker: ## Runs `pnpm turbo build:docker` | ||
pnpm turbo build:docker | ||
|
||
# --------------------- | ||
# - Helper functions - | ||
# --------------------- | ||
|
||
.PHONY: help select | ||
.DEFAULT_GOAL := select | ||
|
||
select: | ||
@make help | sed '1,2d' | \ | ||
fzf --ansi --bind "enter:execute(make {1} < /dev/tty > /dev/tty 2>&1)+abort" || true | ||
|
||
# Help command taken from: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html | ||
help: | ||
@echo "Usage: make [task]\n" | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\x1b[0m %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"private": true, | ||
"scripts": {}, | ||
"devDependencies": { | ||
"turbo": "1.12.2", | ||
"@biomejs/biome": "1.5.3" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
# Use a Node.js base image | ||
FROM node:18 | ||
FROM node:20-slim AS build | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
# Set working directory | ||
WORKDIR /react | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package.json ./ | ||
|
||
# Copy yarn.lock | ||
# COPY yarn.lock ./ | ||
WORKDIR /app | ||
COPY . . | ||
|
||
# Install dependencies | ||
RUN yarn | ||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm --filter bff-frontend-poc run build | ||
|
||
# Copy the rest of the client code | ||
COPY . . | ||
# --- | ||
|
||
# Build the React app | ||
RUN yarn run build | ||
FROM nginx:1.25-alpine | ||
COPY --from=build /app/packages/bff-frontend-poc/dist/ /usr/share/nginx/html/ | ||
|
||
# Expose the port React app runs on (default: 3000) | ||
EXPOSE 80 | ||
|
||
# Command to start the React app | ||
CMD [ "yarn", "docker" ] | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
# Use a Node.js base image | ||
FROM node:18 | ||
FROM node:20-slim AS build | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json | ||
COPY package.json ./ | ||
|
||
# Copy yarn.lock | ||
COPY yarn.lock ./ | ||
|
||
# Install dependencies | ||
RUN yarn install | ||
|
||
# Copy the rest of the server code | ||
COPY . . | ||
|
||
# Expose the port your Node.js server runs on (default: 5000) | ||
EXPOSE 3000 | ||
RUN pnpm install --frozen-lockfile | ||
|
||
# Command to start the Node.js server | ||
CMD [ "yarn", "dev" ] | ||
EXPOSE 3000 | ||
CMD [ "pnpm", "dev" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM node:20-slim AS build | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm --filter frontend-design-poc run build | ||
|
||
# --- | ||
|
||
FROM nginx:1.25-alpine | ||
COPY --from=build /app/packages/frontend-design-poc/dist/ /usr/share/nginx/html/ | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
storybook-static/ | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM node:20-slim AS build | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm --filter storybook run build | ||
|
||
# --- | ||
|
||
FROM nginx:1.25-alpine | ||
COPY --from=build /app/packages/storybook/storybook-static/ /usr/share/nginx/html/ | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,10 @@ | |
"typecheck": { | ||
"outputs": [], | ||
"cache": false | ||
}, | ||
"build:docker": { | ||
"outputs": [], | ||
"cache": false | ||
} | ||
|
||
} | ||
} |