Skip to content

Commit 7fd2e01

Browse files
authored
GH-749: [LanguagesV2] First Page (#750)
1 parent ee557c1 commit 7fd2e01

26 files changed

+20153
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
pull_request:
3+
branches: [ main ]
4+
types:
5+
- labeled
6+
- synchronize
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}/languages-v2-web
11+
VERSION: 0.0.1
12+
13+
jobs:
14+
docker:
15+
if: ${{ github.event.label.name == 'build-languages-v2-web' }}
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v2
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
- name: Login to ghcr.io
25+
uses: docker/login-action@v2
26+
with:
27+
registry: ${{ env.REGISTRY }}
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@v4
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
labels: |
36+
org.opencontainers.image.version=${{ env.VERSION }}
37+
org.opencontainers.image.description="$(cat ./apps/languagesv2/languages-v2-web/README.md)"
38+
tags: |
39+
type=raw,value=${{ env.VERSION }}
40+
- name: Build and push
41+
uses: docker/build-push-action@v2
42+
with:
43+
context: ./apps/languagesv2/languages-v2-web/
44+
file: ./apps/languagesv2/languages-v2-web/Dockerfile
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '3.8'
2+
3+
services:
4+
languages-v2-web:
5+
platform: linux/amd64
6+
image: ghcr.io/undertheseanlp/underthesea/languages-v2-web:0.0.1
7+
ports:
8+
- "8080:80"
9+
restart: unless-stopped
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.env
3+
*.log
4+
build
5+
.DS_Store
6+
.git
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Dockerfile for building the React app with TypeScript
2+
3+
# Step 1: Use an official Node.js image to create the build environment
4+
FROM node:18-alpine AS build
5+
6+
# Set the working directory
7+
WORKDIR /app
8+
9+
# Copy the package.json and package-lock.json files
10+
COPY package*.json ./
11+
12+
# Install dependencies
13+
RUN npm install
14+
15+
# Copy the rest of the application files
16+
COPY . .
17+
18+
# Build the React app
19+
RUN npm run build
20+
21+
# Step 2: Use an Nginx image to serve the built files
22+
FROM nginx:alpine
23+
24+
# Copy the built files from the previous stage
25+
COPY --from=build /app/build /usr/share/nginx/html
26+
27+
# Expose port 80 to serve the application
28+
EXPOSE 80
29+
30+
# Start Nginx
31+
CMD ["nginx", "-g", "daemon off;"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Getting Started with Create React App
2+
3+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `npm start`
10+
11+
Runs the app in the development mode.\
12+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13+
14+
The page will reload if you make edits.\
15+
You will also see any lint errors in the console.
16+
17+
### `npm test`
18+
19+
Launches the test runner in the interactive watch mode.\
20+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21+
22+
### `npm run build`
23+
24+
Builds the app for production to the `build` folder.\
25+
It correctly bundles React in production mode and optimizes the build for the best performance.
26+
27+
The build is minified and the filenames include the hashes.\
28+
Your app is ready to be deployed!
29+
30+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31+
32+
### `npm run eject`
33+
34+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35+
36+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37+
38+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39+
40+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41+
42+
## Learn More
43+
44+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45+
46+
To learn React, check out the [React documentation](https://reactjs.org/).

0 commit comments

Comments
 (0)