Skip to content

Commit 15a4bce

Browse files
committed
Adding scaffold for React
1 parent 5b413c6 commit 15a4bce

24 files changed

+2271
-176
lines changed

Diff for: .env

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ PYTHON_TAG=3.11.4-buster
66
PYTHON_POETRY_VERSION=1.7.1
77
SERVER_PORT=3000
88

9+
# Node
10+
NODE_TAG=18.19.1-buster
11+
CLIENT_PORT=8080
12+
13+
#NGINX
14+
NGINX_TAG=1.25
15+
916
# Postgres
1017
POSTGRES_TAG=15.3-bullseye
1118
DB_NAME=iris
@@ -39,4 +46,5 @@ ADMINER_PORT=8081
3946

4047
# Image Repository
4148
GITHUB_CONTAINER_REPO_SERVER=ghcr.io/jbris/fastapi-react-graphql
49+
GITHUB_CONTAINER_REPO_CLIENT=ghcr.io/jbris/fastapi-react-graphql-client
4250
APP_VERSION=0.0.1

Diff for: .github/workflows/server-docker-image.yml renamed to .github/workflows/docker-image.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Server Docker Build
1+
name: Docker Build
22

33
on:
44
workflow_dispatch: {}
@@ -17,14 +17,14 @@ jobs:
1717
uses: docker/setup-qemu-action@v3
1818
- name: Set up Docker Buildx
1919
uses: docker/setup-buildx-action@v3
20+
- name: Docker build
21+
run: bash ./scripts/build.sh
2022
- name: Login to GitHub Package Registry
2123
uses: docker/login-action@v2
2224
with:
2325
registry: ghcr.io
2426
username: ${{ github.repository_owner }}
2527
password: ${{ secrets.GHCR_TOKEN }}
26-
- name: Docker build
27-
run: bash ./scripts/build.sh
2828
- name: Docker push
2929
run: bash ./scripts/push.sh
3030

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![pages-build-deployment](https://github.com/JBris/fastapi-react-graphql/actions/workflows/pages/pages-build-deployment/badge.svg?branch=main)](https://github.com/JBris/fastapi-react-graphql/actions/workflows/pages/pages-build-deployment)
44
[![CodeQL](https://github.com/JBris/fastapi-react-graphql/actions/workflows/github-code-scanning/codeql/badge.svg?branch=main)](https://github.com/JBris/fastapi-react-graphql/actions/workflows/github-code-scanning/codeql)
5-
[![Server Docker Build](https://github.com/JBris/fastapi-react-graphql/actions/workflows/server-docker-image.yml/badge.svg?branch=main)](https://github.com/JBris/fastapi-react-graphql/actions/workflows/server-docker-image.yml)
5+
[![Server Docker Build](https://github.com/JBris/fastapi-react-graphql/actions/workflows/docker-image.yml/badge.svg?branch=main)](https://github.com/JBris/fastapi-react-graphql/actions/workflows/docker-image.yml)
66
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
77

88
Example of a FastAPI and React.js app using GraphQL.

Diff for: client/.env.development

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VITE_APP_NAME=fastapi-react-graphql
2+
VITE_APP_VERSION=1.0.0
3+
VITE_GRAPHQL_URL=http://localhost:3000

Diff for: client/.env.production

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VITE_APP_NAME=fastapi-react-graphql
2+
VITE_APP_VERSION=1.0.0
3+
VITE_GRAPHQL_URL=http://server:3000

Diff for: client/Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ARG NODE_TAG
2+
3+
ARG NGINX_TAG
4+
5+
from node:${NODE_TAG} as builder
6+
7+
WORKDIR /app
8+
9+
COPY package*.json ./
10+
11+
RUN npm install
12+
13+
COPY . .
14+
15+
RUN npm run build-production
16+
17+
FROM nginx:${NGINX_TAG} as deploy
18+
19+
COPY --from=builder /app/dist /usr/share/nginx/html
20+
21+
EXPOSE 80
22+
23+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)