Dockerize a Rect App (vite) inside a Turborepo

Search for a command to run...

No comments yet. Be the first to comment.
A practical guide to Deepsec, Vercel's security harness: how to configure it correctly with your Claude Code subscription, run scans on your codebase, troubleshoot common issues, and triage findings effectively.
Guía práctica de deepsec Guía completa para usar deepsec — el security harness de Vercel — entendiendo qué hace cada comando, cómo configurarlo correctamente para usar tu suscripción de Claude Code (e
Using Grafana, Prometheus, Node Exporter, cAdvisor, and Loki, Exposed via NGINX
Jupyter Lite Notebook is an incredibly versatile tool for working with code and data interactively and collaboratively.

Description: This Docker image is designed to provide an ultra-lightweight HTTP server optimized for efficiently serving static files. It is based on the Busybox system and utilizes the Applet HTTPD for web server functionality.
General Image Details:
Base Image: diegofcornejo/httpd-lite:latest
Purpose: Efficiently serve static files.
Size: The image size has been optimized to be as lightweight as possible, making it ideal for quick and efficient deployments of static content in containerized environments. (158kb)
# Serve static files from the current directory
# Create a configuration file if you don't have one
touch httpd.conf
# Run the container with the following command:
docker run -p 80:8080 --init --rm -ti -v "$(PWD):/home/static" diegofcornejo/httpd-lite:latest
Here's an example of how to use this image. The CMD instruction is optional but can be used to replace the parameters as needed:
FROM diegofcornejo/httpd-lite:latest as production
EXPOSE 8080
# Copy your static files
COPY . .
CMD ["/busybox", "httpd", "-f", "-v", "-p", "8080", "-c", "httpd.conf"]
Assuming you have a project structure like this:
├── turbo.json
├── package.json
├── yarn.lock
├── README.md
└── apps
└── myapp
├── src
├── index.html
└── Dockerfile
# Base image
FROM alpine:3.18.4 as build
RUN apk update
RUN apk add --no-cache nodejs npm
RUN npm install -g yarn
# Create app directory
WORKDIR /app
# Copy the whole project
COPY ../../ .
# Install dependencies
RUN yarn install
# Build the app
RUN yarn workspace myapp build
# Production stage
FROM diegofcornejo/httpd-lite:latest as production
# Copy build artifacts from the build-vite stage
COPY --from=build /app/apps/myapp/dist .
EXPOSE 8080
# To build the docker image, run the following command:
docker build -f apps/myapp/Dockerfile -t myreactapp:latest .
# To run the docker image, run the following command:
docker run -p 80:8080 --init --rm -ti myreactapp:latest
# Or in detach mode (background):
docker run -p 80:8080 --init --rm -d myreactapp:latest
# Now Open your browser and go to http://localhost:80
# To stop the docker image, run the following command:
docker stop <container_id>
Note: When running the container, sending a TERM signal to your TTY won't get propagated due to how Busybox is built. Instead, you can call docker stop (or docker kill if you can't wait 15 seconds). Alternatively, you can run the container with docker run -it --rm --init, which will propagate signals to the process correctly.