
Co-authored-by: dunemask <dunemask@gmail.com> Reviewed-on: https://gitea.dunemask.net/elysium/khufu/pulls/4
26 lines
882 B
Docker
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"]
|