Files
the-nexus/Dockerfile
Alexander Whitestone d41b5b30ed
Some checks failed
CI / validate (pull_request) Failing after 5s
feat: add proxy server to fix CORS issue
Adds a simple Node.js express server to proxy requests to the Gitea API.
This avoids the CORS error that was happening in the frontend.

The following changes were made:
- Added a  file with the proxy server.
- Updated  with  and .
- Updated  to use the proxy.
- Created a  file to proxy API requests.
- Updated the  to a multi-stage build.
- Updated  to run the new container.

Fixes #512
2026-03-25 11:36:11 -04:00

35 lines
912 B
Docker

# Stage 1: Build the Node.js server
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# Stage 2: Create the final Nginx image
FROM nginx:alpine
# Copy the Node.js server from the builder stage
COPY --from=builder /app /app
# Copy the static files
COPY . /usr/share/nginx/html
RUN rm -f /usr/share/nginx/html/Dockerfile \
/usr/share/nginx/html/docker-compose.yml \
/usr/share/nginx/html/deploy.sh \
/usr/share/nginx/html/server.js \
/usr/share/nginx/html/package.json \
/usr/share/nginx/html/package-lock.json \
/usr/share/nginx/html/node_modules
# Copy the Nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Expose port 80 for Nginx and 3001 for the Node.js server
EXPOSE 80
EXPOSE 3001
# Start both Nginx and the Node.js server
CMD ["sh", "-c", "node /app/server.js & nginx -g 'daemon off;'"]