blob: 7a2c2214d98b11d40fdd34ab97570f49c2dbe4e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# --------------------------------------------------------------------------
# Dockerfile — Development image for the Bicycle Wheel Circumference app.
#
# Key concepts:
# • Uses the official Node.js Alpine image, which ships with Node and npm
# pre-installed — no version manager needed.
# • Alpine Linux produces a very small image (~50 MB base layer).
# • The working directory is /app, which will be bind-mounted at runtime
# so edits on the host are immediately visible inside the container.
# • The entrypoint script installs npm deps (if needed) and starts the
# Vite dev server, which serves on 0.0.0.0 so it is LAN-accessible.
# --------------------------------------------------------------------------
# --- Base image ---
# The official Node.js Alpine image bundles Node 25.x and npm.
# Alpine keeps the image footprint minimal.
FROM node:25-alpine
# --- Working directory ---
# At runtime the project root is bind-mounted here, so the source code
# inside the container always mirrors the host filesystem.
WORKDIR /app
# --- Entrypoint ---
# A small script that:
# 1. Installs npm dependencies (handles first run or new packages).
# 2. Starts the Vite dev server bound to 0.0.0.0:5173.
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 5173
ENTRYPOINT ["docker-entrypoint.sh"]
|