Compare commits

..

3 Commits

Author SHA1 Message Date
fea610797d Trying to enable PRODUCTION docker-compose
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
2023-01-19 21:19:10 -08:00
078e96ec2c Update .dockerignore
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
2023-01-19 19:00:59 -08:00
5cc6209d5c Merged 2023-01-19 19:00:59 -08:00
2 changed files with 62 additions and 39 deletions

View File

@ -1,17 +1,12 @@
* *
!.babelrc
!*.json
!*.html
!*.js
!*.sh
!*.md
!config !config
!db
!docker-compose.yml
!Dockerfile
!entrypoint.sh
!face.js
!frontend !frontend
!package.json
!package-lock.json
!password.js
!query.sh
!README.md
!reset-db.sh
!server !server
!scanner !scanner
!src !src
@ -19,6 +14,10 @@
!ketrface !ketrface
!client !client
!scripts !scripts
!Dockerfile
!entrypoint.sh
node_modules
frontend/bower_modules
client/node_modules client/node_modules
server/node_modules server/node_modules

View File

@ -1,10 +1,58 @@
FROM ubuntu:jammy ARG DEVELOPMENT=
FROM ubuntu:jammy AS base
RUN apt-get update \ RUN apt-get update \
&& DEBIAN_FRONTEND=NONINTERACTIVE apt-get upgrade -y && DEBIAN_FRONTEND=NONINTERACTIVE apt-get upgrade -y
RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \ RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \
wget \ wget
# Upgrade Node
RUN wget -qO- https://deb.nodesource.com/setup_18.x | bash -
RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \
nodejs
# Install the latest npm and npx
RUN npm install --global npm@latest
FROM base AS production
RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \
git
WORKDIR /website
COPY /*.json /website/
RUN npm upgrade && npm install
COPY /.babelrc /*.html /*.js /website/
COPY /src /website/src
COPY /frontend /website/frontend
RUN npm run build
RUN ls -altr /website
WORKDIR /website/client
COPY /client/*.json /website/client/
RUN npm upgrade && npm install
COPY /client/*.js /website/client/
COPY /client/public /website/client/public
COPY /client/src /website/client/src
RUN npm run build
RUN ls -altr /website/client
RUN echo $DEVELOPMENT
FROM base AS runtime1
ONBUILD COPY --from=production /website/dist /website/dist
ONBUILD COPY --from=production /website/*.html /website/
ONBUILD COPY --from=production /website/client/*.html /website/client/
ONBUILD COPY --from=production /website/client/dist /website/client/dist
FROM base AS runtime
FROM runtime${DEVELOPMENT}
RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \
pip \ pip \
libgl1 \ libgl1 \
libglib2.0-0 \ libglib2.0-0 \
@ -12,15 +60,9 @@ RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \
rsync \ rsync \
less \ less \
git \ git \
sqlite3 sqlite3 \
# Upgrade Node
RUN wget -qO- https://deb.nodesource.com/setup_18.x | bash -
RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \
python2 \ python2 \
jhead \ jhead \
nodejs \
jq \ jq \
nano \ nano \
shellinabox \ shellinabox \
@ -28,9 +70,6 @@ RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \
curl \ curl \
less less
# Install the latest npm and npx
RUN npm install --global npm@latest
# Install deepface # Install deepface
RUN pip install deepface RUN pip install deepface
RUN pip install piexif RUN pip install piexif
@ -39,31 +78,16 @@ RUN pip install piexif
# install <1.24 # install <1.24
RUN pip install "numpy<1.24" RUN pip install "numpy<1.24"
COPY /package*json /website/
WORKDIR /website
RUN npm upgrade && npm install
WORKDIR /website/client
COPY /client/package*json /website/client/
RUN npm upgrade && npm install
COPY /server /website/server COPY /server /website/server
WORKDIR /website/server WORKDIR /website/server
RUN npm upgrade && npm install RUN npm install
COPY /config/default.json /website/config/default.json COPY /config/default.json /website/config/default.json
COPY /*js /website/
COPY /src /website/src
COPY /client /website/client
COPY /scanner /website/scanner
COPY /frontend /website/frontend
COPY /ketrface /website/ketrface COPY /ketrface /website/ketrface
# Switch to bash instead of sh # Switch to bash instead of sh
SHELL [ "/bin/bash", "-c" ] SHELL [ "/bin/bash", "-c" ]
ARG DEVELOPMENT=
RUN cp /website/server/nginx.conf /etc/nginx/sites-enabled/default RUN cp /website/server/nginx.conf /etc/nginx/sites-enabled/default
# If not DEVELOPMENT mode, copy production config, else development # If not DEVELOPMENT mode, copy production config, else development