Files
firegex-traffic-viewer/Dockerfile

44 lines
1.2 KiB
Docker
Raw Normal View History

2022-06-12 20:02:05 +02:00
#Frontend build
2022-06-12 22:28:16 +02:00
FROM node:lts-alpine AS frontend
2022-06-12 20:02:05 +02:00
RUN apk add --update npm
RUN mkdir /app
WORKDIR /app
2022-06-12 22:28:16 +02:00
ENV PATH /app/node_modules/.bin:$PATH
2022-06-12 20:02:05 +02:00
ADD ./frontend/package.json .
ADD ./frontend/package-lock.json .
2022-06-12 22:28:16 +02:00
RUN npm ci --silent
2022-06-12 20:02:05 +02:00
COPY ./frontend/ .
RUN npm run build
#Building main conteiner
2022-06-12 22:28:16 +02:00
FROM python:slim-buster
2022-06-11 21:57:50 +02:00
2022-06-12 22:28:16 +02:00
RUN apt-get update && apt-get -y install curl supervisor gettext-base build-essential libboost-dev nginx
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash
RUN apt-get install nodejs
RUN npm install serve -g --silent
2022-06-11 21:57:50 +02:00
RUN mkdir /execute
WORKDIR /execute
2022-06-12 22:28:16 +02:00
ADD ./backend/requirements.txt /execute/requirements.txt
2022-06-11 21:57:50 +02:00
RUN pip install --no-cache-dir -r /execute/requirements.txt
2022-06-12 22:28:16 +02:00
COPY ./backend/ /execute/
2022-06-12 18:50:57 +02:00
COPY ./config/supervisord.conf /etc/supervisor/supervisord.conf
2022-06-12 22:28:16 +02:00
COPY ./config/nginx.conf /tmp/nginx.conf
COPY ./config/start_nginx.sh /tmp/start_nginx.sh
2022-06-11 21:57:50 +02:00
2022-06-12 20:02:05 +02:00
#Copy react app in the main container
COPY --from=frontend /app/build/ ./frontend/
2022-06-11 21:57:50 +02:00
RUN usermod -a -G root nobody
RUN chown -R nobody:root /execute && \
chmod -R 660 /execute && chmod -R u+X /execute
2022-06-12 20:02:05 +02:00
ENTRYPOINT ["/usr/bin/supervisord","-c","/etc/supervisor/supervisord.conf"]