Files
safemarks-server/Dockerfile
Julian Freeman 4ffffd2d64 add dockerfile
2025-12-01 19:13:07 -04:00

33 lines
819 B
Docker

# Dockerfile for a Bun + Hono + SQLite application
# --- Base Image ---
FROM oven/bun:1-alpine
# --- Environment Variables ---
ENV NODE_ENV=production
# --- Working Directory ---
WORKDIR /app
# --- Copy package.json and bun.lockb to leverage Docker cache ---
COPY package.json bun.lockb ./
# --- Install Dependencies ---
# Do not install devDependencies to keep the image small
RUN bun install --frozen-lockfile --production
# --- Copy application source code ---
COPY . .
# --- Create dedicated directory for SQLite database ---
# Declare a VOLUME for the database directory so data persists after container restarts.
RUN mkdir -p /app/data
VOLUME /app/data
# --- Expose Port ---
EXPOSE 3000
# --- Command to run the application ---
# Ensure the Hono app listens on 0.0.0.0
CMD ["bun", "run", "src/index.ts"]