mirror of
https://github.com/tcsenpai/emoji-encoder.git
synced 2025-06-04 09:40:05 +00:00
added docker compose
This commit is contained in:
parent
9f84921d7d
commit
e3b0e22a7b
5
.gitignore
vendored
5
.gitignore
vendored
@ -24,4 +24,7 @@ yarn-error.log*
|
|||||||
|
|
||||||
# typescript
|
# typescript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
next-env.d.ts
|
next-env.d.ts
|
||||||
|
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
41
Dockerfile
41
Dockerfile
@ -1,36 +1,21 @@
|
|||||||
# Base node image
|
FROM oven/bun:1
|
||||||
FROM node:20-alpine AS base
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Dependencies stage
|
# Copy package files
|
||||||
FROM base AS deps
|
COPY package*.json bun.lockb ./
|
||||||
COPY package.json package-lock.json ./
|
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
# Builder stage
|
# Install dependencies including Next.js
|
||||||
FROM base AS builder
|
RUN bun install --verbose
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
|
||||||
|
# Copy the rest of the application
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Runner stage
|
# Build the application
|
||||||
FROM base AS runner
|
RUN bun run build
|
||||||
ENV NODE_ENV=production
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
|
||||||
|
|
||||||
# Create non-root user
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
|
||||||
RUN adduser --system --uid 1001 nextjs
|
|
||||||
|
|
||||||
# Copy necessary files and set permissions
|
|
||||||
COPY --from=builder /app/public ./public
|
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
||||||
|
|
||||||
USER nextjs
|
|
||||||
|
|
||||||
|
# Expose the default Next.js port
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENV PORT 3000
|
|
||||||
ENV HOSTNAME "0.0.0.0"
|
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
# Start the application
|
||||||
|
CMD ["bun", "start"]
|
29
README.md
Normal file
29
README.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Emoji Encoder
|
||||||
|
|
||||||
|
This is a fork of [Emoji Encoder](https://github.com/matt-west/emoji-encoder) with some changes to the codebase.
|
||||||
|
|
||||||
|
The original repository implements https://paulbutler.org/2025/smuggling-arbitrary-data-through-an-emoji/ and is made by the author of the article.
|
||||||
|
|
||||||
|
## What changed?
|
||||||
|
|
||||||
|
Basically nothing. This has just a README.md file and a docker setup to run the emoji encoder with docker.
|
||||||
|
|
||||||
|
Additionally, I switched the package manager to Bun as its faster and works the same.
|
||||||
|
|
||||||
|
## Running the emoji encoder
|
||||||
|
|
||||||
|
### From source
|
||||||
|
|
||||||
|
NOTE: You can use `npm` or `yarn` instead of `bun` to install the dependencies and run the build and start commands.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun install
|
||||||
|
bun run build
|
||||||
|
bun run start
|
||||||
|
```
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose up
|
||||||
|
```
|
@ -1,25 +1,12 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
app:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
network: host
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
restart: unless-stopped
|
|
||||||
healthcheck:
|
|
||||||
test:
|
|
||||||
[
|
|
||||||
"CMD",
|
|
||||||
"wget",
|
|
||||||
"--no-verbose",
|
|
||||||
"--tries=1",
|
|
||||||
"--spider",
|
|
||||||
"http://localhost:3000",
|
|
||||||
]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
|
@ -20,8 +20,7 @@ const nextConfig = {
|
|||||||
webpackBuildWorker: true,
|
webpackBuildWorker: true,
|
||||||
parallelServerBuildTraces: true,
|
parallelServerBuildTraces: true,
|
||||||
parallelServerCompiles: true,
|
parallelServerCompiles: true,
|
||||||
},
|
}
|
||||||
output: "standalone",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mergeConfig(nextConfig, userConfig);
|
mergeConfig(nextConfig, userConfig);
|
||||||
|
1996
package-lock.json
generated
1996
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -45,7 +45,7 @@
|
|||||||
"embla-carousel-react": "8.5.1",
|
"embla-carousel-react": "8.5.1",
|
||||||
"input-otp": "1.4.1",
|
"input-otp": "1.4.1",
|
||||||
"lucide-react": "^0.454.0",
|
"lucide-react": "^0.454.0",
|
||||||
"next": "14.2.16",
|
"next": "^15.1.7",
|
||||||
"next-themes": "^0.4.4",
|
"next-themes": "^0.4.4",
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
"react-day-picker": "8.10.1",
|
"react-day-picker": "8.10.1",
|
||||||
@ -57,6 +57,7 @@
|
|||||||
"tailwind-merge": "^2.5.5",
|
"tailwind-merge": "^2.5.5",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"vaul": "^0.9.6",
|
"vaul": "^0.9.6",
|
||||||
|
"yarn": "^1.22.22",
|
||||||
"zod": "^3.24.1"
|
"zod": "^3.24.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user