Skip to content

Commit

Permalink
minimal testing env
Browse files Browse the repository at this point in the history
  • Loading branch information
Frohrer committed Jul 1, 2024
1 parent 31b8175 commit 793fa70
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/buildImage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Deploy to Bunny.net

on:
push:
branches: ["main"]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"

- name: Make lock file
run: npm i --package-lock-only

- name: Install dependencies
run: npm ci

- name: Build application
run: npm run build

- name: Deploy to Bunny.net via FTP
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_HOSTNAME }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: "./dist/"
server-dir: "/"
4 changes: 2 additions & 2 deletions components/hero-home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export default function HeroHome() {
data-aos="zoom-y-out"
data-aos-delay={150}
>
The website builder you're <br className="max-lg:hidden" />
looking for
Your businesses AI intake <br className="max-lg:hidden" />
to make $$$
</h1>
<div className="mx-auto max-w-3xl">
<p
Expand Down
2 changes: 1 addition & 1 deletion components/ui/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Footer({ border = false }: { border?: boolean }) {
<Logo />
</div>
<div className="text-sm text-gray-600">
&copy; Cruip.com - All rights reserved.
&copy; Backland Labs Inc. - All rights reserved.
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion components/ui/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function Header() {
href="/signup"
className="btn-sm bg-gray-800 text-gray-200 shadow hover:bg-gray-900"
>
Register
Sign Up
</Link>
</li>
</ul>
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
app:
build: .
ports:
- "3002:80"
environment:
- NODE_ENV=production
37 changes: 37 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Use the official Node.js image as the base image for building
FROM node:lts-slim AS build

# Set the working directory inside the container
WORKDIR /app

# Copy the package.json and package-lock.json files to the working directory
COPY package.json ./
RUN npm i --package-lock-only

# Install the project dependencies
RUN npm ci

# Copy the rest of the project files to the working directory
COPY . .

# Build the Next.js application and export it as static files
RUN npm run build

# Use the official Nginx image as the base image for serving
FROM nginx:stable-alpine

# Copy the built files from the previous stage to the nginx html directory
COPY --from=build /app/dist /usr/share/nginx/html

# Copy the nginx configuration file
COPY nginx.conf /etc/nginx/nginx.conf

# Forward Nginx logs to Docker's stdout and stderr
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

# Expose the port on which the application will run
EXPOSE 80

# Start the Nginx server
CMD ["nginx", "-g", "daemon off;"]
8 changes: 7 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
output: "export",
images: {
unoptimized: true,
},
distDir: "dist",
};

module.exports = nextConfig;
27 changes: 27 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile on;
keepalive_timeout 65;

server {
listen 80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}

error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
}
}

0 comments on commit 793fa70

Please sign in to comment.