mirror of
https://github.com/tcsenpai/emoji-encoder.git
synced 2025-06-02 16:50:06 +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
|
||||
*.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 node:20-alpine AS base
|
||||
FROM oven/bun:1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Dependencies stage
|
||||
FROM base AS deps
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
# Copy package files
|
||||
COPY package*.json bun.lockb ./
|
||||
|
||||
# Builder stage
|
||||
FROM base AS builder
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
# Install dependencies including Next.js
|
||||
RUN bun install --verbose
|
||||
|
||||
# Copy the rest of the application
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Runner stage
|
||||
FROM base AS runner
|
||||
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
|
||||
# Build the application
|
||||
RUN bun run build
|
||||
|
||||
# Expose the default Next.js port
|
||||
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"
|
||||
|
||||
services:
|
||||
web:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
network: host
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- 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,
|
||||
parallelServerBuildTraces: true,
|
||||
parallelServerCompiles: true,
|
||||
},
|
||||
output: "standalone",
|
||||
}
|
||||
};
|
||||
|
||||
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",
|
||||
"input-otp": "1.4.1",
|
||||
"lucide-react": "^0.454.0",
|
||||
"next": "14.2.16",
|
||||
"next": "^15.1.7",
|
||||
"next-themes": "^0.4.4",
|
||||
"react": "^18",
|
||||
"react-day-picker": "8.10.1",
|
||||
@ -57,6 +57,7 @@
|
||||
"tailwind-merge": "^2.5.5",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"vaul": "^0.9.6",
|
||||
"yarn": "^1.22.22",
|
||||
"zod": "^3.24.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user