|
FROM nikolaik/python-nodejs:python3.11-nodejs21 |
|
|
|
|
|
USER root |
|
RUN apt-get -y update && apt-get -y install nginx |
|
|
|
|
|
RUN mkdir -p /var/cache/nginx \ |
|
/var/log/nginx \ |
|
/var/lib/nginx \ |
|
/var/www/html \ |
|
/usr/share/nginx/html |
|
RUN touch /var/run/nginx.pid && touch /var/log/nginx/error.log |
|
|
|
|
|
RUN chown -R pn:pn /var/cache/nginx \ |
|
/var/log/nginx \ |
|
/var/lib/nginx \ |
|
/var/run/nginx.pid \ |
|
/var/www/html \ |
|
/var/log/nginx/error.log \ |
|
/usr/share/nginx/html |
|
|
|
|
|
USER pn |
|
ENV HOME=/home/pn \ |
|
PATH=/home/pn/.local/bin:$PATH |
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
COPY --chown=pn requirements.txt requirements.txt |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY --chown=pn frontend frontend |
|
WORKDIR $HOME/app/frontend |
|
RUN npm install |
|
RUN npm run build && cp -r dist/. /usr/share/nginx/html && ls /usr/share/nginx/html |
|
|
|
|
|
|
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
COPY --chown=pn backend backend |
|
|
|
|
|
COPY --chown=pn nginx.conf /etc/nginx/sites-available/default |
|
|
|
|
|
RUN ls -a |
|
|
|
COPY --chown=pn run.sh run.sh |
|
RUN ls -a |
|
RUN chmod +x run.sh |
|
|
|
|
|
EXPOSE 8080 8000 |
|
|
|
CMD ["bash", "run.sh"] |
|
|