Add Docker support and implement Bun for dependency management
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m25s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m25s
- Introduced .dockerignore to exclude unnecessary files from Docker context. - Updated Dockerfile to use Bun for building and running the application. - Removed entrypoint.sh as it is no longer needed. - Modified build-and-dockerise.yml to set up Bun and install dependencies. - Enhanced index.html with improved structure and hover effects. - Updated client.ts to include tooltips for music display. - Implemented caching in server.ts for Last.fm data. - Added custom styles for hover effects and tooltips in style.css.
This commit is contained in:
parent
be5a61185b
commit
214982649f
9 changed files with 272 additions and 107 deletions
40
Dockerfile
40
Dockerfile
|
@ -1,11 +1,37 @@
|
|||
FROM nginx:latest
|
||||
# Build stage
|
||||
FROM oven/bun:latest as builder
|
||||
|
||||
COPY dist /usr/share/nginx/html
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
WORKDIR /app
|
||||
|
||||
RUN chmod +x /entrypoint.sh
|
||||
# Copy package files
|
||||
COPY package.json bun.lock* ./
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
# Install all dependencies (including devDependencies for building)
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
STOPSIGNAL SIGQUIT
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN bun run build
|
||||
|
||||
# Production stage
|
||||
FROM oven/bun:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package.json bun.lock* ./
|
||||
|
||||
# Install only production dependencies
|
||||
RUN bun install --frozen-lockfile --production
|
||||
|
||||
# Copy built application and server
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY src/server.ts ./src/server.ts
|
||||
|
||||
# Expose the port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the application
|
||||
CMD ["bun", "run", "prod"]
|
Loading…
Add table
Add a link
Reference in a new issue