Skip to content
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
Add dockerfile
  • Loading branch information
dimaioksha committed May 18, 2024
commit 3e1e9df70d2d2f5ee0ef5ae32fe11bfe2418f9be
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ yarn-error.log*

# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
.idea/
.env
.env*.local

Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ Special thanks to [Diagram](https://diagram.com/) for sponsorship and guidance.

https://user-images.githubusercontent.com/1443449/222598119-0a5a536e-6785-44ad-ba28-e26e04f15163.mp4

## Getting started

You can manually build `Tiktokenizer` using Docker:

```bash
echo "HF_API_KEY=<YOUR_API_KEY>" >> .env
docker compose -f docker/docker-compose.yml up -d
```

After execution you will be able to see working application at `localhost:3000`

## Acknowledgments

- [T3 Stack](https://create.t3.gg/)
Expand Down
13 changes: 13 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22.2.0-slim

ARG HF_API_KEY
ARG NODE_ENV
WORKDIR /app

COPY yarn.lock package.json ./
RUN yarn install

COPY . .
RUN yarn build

CMD ["yarn", "start"]
15 changes: 15 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3.9"

services:
tiktokenizer:
build:
context: ../
dockerfile: docker/Dockerfile
args:
HF_API_KEY: ${HF_API_KEY}
NODE_ENV: "development"
ports:
- "3000:3000"
environment:
HF_API_KEY: ${HF_API_KEY}
NODE_ENV: "production"