mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 08:56:52 +00:00
feat: containerize backend and frontend services
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
.venv
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
FROM astral/uv:python3.13-bookworm-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY pyproject.toml uv.lock ./
|
||||||
|
RUN uv sync --frozen --no-dev
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
CMD ["uv", "run", "--frozen", "gunicorn", "--bind", "0.0.0.0:8000", "config.wsgi:application"]
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
node_modules
|
||||||
|
test-results
|
||||||
|
playwright-report
|
||||||
|
dist
|
||||||
|
coverage
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
FROM oven/bun:1 AS bun
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json bun.lock* ./
|
||||||
|
RUN bun install --frozen-lockfile
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
ARG BACKEND_DOMAIN
|
||||||
|
ARG BACKEND_PORT
|
||||||
|
ARG SSL_ENABLED
|
||||||
|
ARG VITE_API_URL
|
||||||
|
|
||||||
|
ENV BACKEND_DOMAIN=$BACKEND_DOMAIN
|
||||||
|
ENV BACKEND_PORT=$BACKEND_PORT
|
||||||
|
ENV SSL_ENABLED=$SSL_ENABLED
|
||||||
|
|
||||||
|
ENV VITE_API_URL=$VITE_API_URL
|
||||||
|
|
||||||
|
RUN bun run build:prod
|
||||||
|
|
||||||
|
FROM nginxinc/nginx-unprivileged:alpine-slim
|
||||||
|
RUN touch /tmp/access.log /tmp/error.log
|
||||||
|
RUN rm /etc/nginx/conf.d/*
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --from=bun /app/dist /usr/share/nginx/html
|
||||||
|
# transfer the ownership since nginx is running rootless
|
||||||
|
USER root
|
||||||
|
RUN chown -R nginx:nginx /usr/share/nginx/html
|
||||||
|
USER nginx
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
ENTRYPOINT ["nginx", "-e", "/tmp/error.log", "-g", "daemon off;"]
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
pid /tmp/nginx.pid;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
access_log /tmp/access.log;
|
||||||
|
error_log /tmp/error.log;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8080;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri /index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user