WHAT: Updates the application's default port from 8080 to 3004 across various Docker configurations and scripts. This includes changes to Dockerfiles, docker-compose files, and startup scripts. Also updates the vite config. WHY: Standardizes the port used by the application to 3004 for consistency and to avoid potential conflicts with other services that might be using port 8080. HOW: Modifies the `EXPOSE` directives in the Dockerfiles, the port mappings in the docker-compose files, the default port in the main application server file, the port in the vite config and the scripts that display the API URL.
26 lines
700 B
Text
26 lines
700 B
Text
FROM node:20-bullseye-slim
|
|
ENV npm_config_registry=https://registry.npmmirror.com
|
|
ENV npm_config_build_from_source=true
|
|
|
|
# Build prerequisites for native modules (better-sqlite3)
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends python3 make g++ \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Install server deps in container (native modules match linux/amd64)
|
|
COPY server/package.json ./server/package.json
|
|
RUN cd server && npm install --omit=dev --build-from-source
|
|
|
|
# Copy server runtime and prebuilt frontend from host
|
|
COPY server/dist ./server/dist
|
|
COPY dist ./frontend
|
|
|
|
ENV PORT=3004
|
|
ENV DB_PATH=/data/purchase.db
|
|
|
|
EXPOSE 3004
|
|
CMD ["node", "server/dist/index.js"]
|
|
|
|
|