add readme and dockers and make this presentable lol
This commit is contained in:
4
README.md
Normal file
4
README.md
Normal file
@ -0,0 +1,4 @@
|
||||
funny app to calculate mini guildford times
|
||||
very alpha, very not working, but hey first react project
|
||||
|
||||

|
||||
22
backend/Dockerfile
Normal file
22
backend/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
||||
FROM golang:1.22.3-alpine as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
# Copy the rest of the application code to the working directory
|
||||
COPY . .
|
||||
|
||||
RUN go build -o main .
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/main .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["./main"]
|
||||
18
docker-compose.yml
Normal file
18
docker-compose.yml
Normal file
@ -0,0 +1,18 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "1307:80" # Map port 80 of the frontend container to port 3000 on localhost
|
||||
depends_on:
|
||||
- backend # Ensure backend service is started before frontend
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "1308:8080" # Map port 8080 of the backend container to port 8080 on localhost
|
||||
29
frontend/Dockerfile
Normal file
29
frontend/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
||||
# Use an official Node runtime as a parent image
|
||||
FROM node:22.2-alpine as build
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and package-lock.json to the working directory
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application code to the working directory
|
||||
COPY . .
|
||||
|
||||
# Build the React app for production
|
||||
RUN npm run build
|
||||
|
||||
# Use nginx as the base image for serving content
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy the build output from the build stage to serve with nginx
|
||||
COPY --from=build /app/build /usr/share/nginx/html
|
||||
|
||||
# Expose port 80 to the Docker network
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx when the container starts
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@ -1,7 +1,33 @@
|
||||
import RelayForm from "./RelayForm";
|
||||
import "./App.css";
|
||||
import { Layout } from "antd";
|
||||
|
||||
const { Footer: AntFooter } = Layout;
|
||||
|
||||
const App: React.FC = () => {
|
||||
return <RelayForm />;
|
||||
return (
|
||||
<>
|
||||
{" "}
|
||||
<RelayForm />
|
||||
<AntFooter
|
||||
style={{
|
||||
textAlign: "center",
|
||||
position: "fixed",
|
||||
bottom: 0,
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<p>
|
||||
<a
|
||||
href="https://git.kehilush.com/omri/relay"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Source Code
|
||||
</a>
|
||||
</p>
|
||||
</AntFooter>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default App;
|
||||
|
||||
Reference in New Issue
Block a user