Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize / Cloudflare #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ FIREBASE_PROJECTID=
FIREBASE_STORAGEBUCKET=
FIREBASE_MESSAGINGSENDERID=
FIREBASE_APPID=
PUBLIC_DISABLE_TRACKING=true
PUBLIC_DISABLE_TRACKING=true
# to test this out with the firebase bypass I just put junk in the empty ones above
# modify the file as this pull shows: https://github.com/ShipBit/slickgpt/pull/78
# then put your cloudflared token in
SLICKGPT_CLOUDFLARED=cloudflared_token_goes_here
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# this specifically jsut runs the preview and
# it doesnt really expose port 3000 or 4173 here
# Use the official Node.js 16 image as a parent image
FROM node:16

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy the package.json and package-lock.json (or yarn.lock) files
COPY package*.json ./

# Install any dependencies
RUN npm install

# Copy the rest of your app's source code
COPY . .

# Build the application for production
RUN npm run build

# Expose the port the app runs on
EXPOSE 3000

# Define the command to run the app
CMD ["npm", "run", "preview","--host"]

29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "3.3"
# update the .env file for all variables used!
# cd dockers
# docker build . -t slickgpt -t slickgpt:$(date +%Y%m%d)
# docker compose -f docker-compose.slickgpt.yml build
# docker-compose -f ./docker-compose.slickgpt.yml down
# docker-compose -f ./docker-compose.slickgpt.yml pull
# docker-compose -f ./docker-compose.slickgpt.yml up -d

# docker compose --env-file ./slickgpt/slickgpt/.env -f ./slickgpt/slickgpt/docker-compose.slickgpt.yml up -d
services:

slickgpt:
image: slickgpt:latest
build: .
command: npm run preview -- --host
# yes you are reading this right -- no ports exposed.
# In your cloudflared configuration portal, you'll point the URL to
# http://slickgpt:4173

slicktunnel:
container_name: cloudflared-slick
image: cloudflare/cloudflared:latest #2023.5.1-amd64
restart: unless-stopped
command: tunnel run
environment:
- TUNNEL_TOKEN=${SLICKGPT_CLOUDFLARED}
cap_drop:
- ALL
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.