Mizdooni front-end (React app on nginx)
70
Mizdooni front-end React application dockerized using nginx.
The image is built using the following Dockerfile:
FROM node:20-alpine AS Build
WORKDIR /app
COPY package*.json .
COPY jsconfig.json .
COPY public public
COPY src src
RUN npm install
RUN npm run build
FROM nginx:1.27.0-alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=Build /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/templates/default.conf.template
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]
Current nginx configuration:
server {
listen 3000;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html =404;
}
location /api/ {
proxy_pass ${NGINX_API_URL};
}
}
Make sure to set the NGINX_API_URL environment variable to Mizdooni's back-end URL.
Content type
Image
Digest
sha256:c3677f73b…
Size
24.2 MB
Last updated
over 2 years ago
docker pull misaghm/miz-front-end:1.0