This repository has been archived on 2024-08-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
khufu/Dockerfile
dunemask 39a882cb18 [CHORE] Migrate to Helm (#4)
Co-authored-by: dunemask <dunemask@gmail.com>
Reviewed-on: https://gitea.dunemask.net/elysium/khufu/pulls/4
2023-08-24 01:02:27 +00:00

26 lines
882 B
Docker

FROM node:16 as build
WORKDIR /dunemask/net/khufu
RUN apt-get update && apt-get install nginx gettext-base -y
COPY package.json .
COPY package-lock.json .
RUN npm i
COPY public public
COPY src src
ARG REACT_APP_CAIRO_URL
ARG REACT_APP_NUBIAN_URL
RUN npm run build:react
COPY server server
# Nginx Setup
WORKDIR /var/www/html
RUN rm -Rf ./*
# Move build nginx and update permissions
RUN cp -R /dunemask/net/khufu/build/* .
# Setup Nginx Config
RUN mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old
COPY nginx/nginx.conf /etc/nginx/template.nginx.conf
RUN envsubst '${REACT_APP_CAIRO_URL},${REACT_APP_NUBIAN_URL}' < /etc/nginx/template.nginx.conf > /etc/nginx/nginx.conf
RUN chown -R www-data:www-data /var/www/html
# Containers run nginx with global directives and daemon off
WORKDIR /dunemask/net/khufu
#ENTRYPOINT ["nginx", "-g", "daemon off;"]
ENTRYPOINT ["npm", "run", "start"]