Added comments to dockerfiles
This commit is contained in:
parent
c9fcf736ff
commit
d6b663e8c8
@ -1,19 +1,28 @@
|
|||||||
FROM python:3.10-alpine
|
FROM python:3.10-alpine
|
||||||
|
|
||||||
|
# Change the working directory to the project root
|
||||||
WORKDIR /srv/flask_app
|
WORKDIR /srv/flask_app
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
RUN apk add nginx build-base libffi-dev curl uwsgi
|
RUN apk add nginx build-base libffi-dev curl uwsgi
|
||||||
|
|
||||||
|
# Install python dependencies
|
||||||
COPY api/requirements.txt /srv/flask_app/
|
COPY api/requirements.txt /srv/flask_app/
|
||||||
|
|
||||||
RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location
|
RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location
|
||||||
|
|
||||||
|
# Copy the app
|
||||||
COPY api /srv/flask_app
|
COPY api /srv/flask_app
|
||||||
COPY api/deploy/nginx.conf /etc/nginx
|
COPY api/deploy/nginx.conf /etc/nginx
|
||||||
|
|
||||||
|
# Change file permissions
|
||||||
RUN chmod +x ./deploy/start.sh
|
RUN chmod +x ./deploy/start.sh
|
||||||
RUN chmod +x ./deploy/healthcheck.sh
|
RUN chmod +x ./deploy/healthcheck.sh
|
||||||
|
|
||||||
|
# Set healthcheck
|
||||||
HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"]
|
HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"]
|
||||||
|
|
||||||
|
# Expose webserver port
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Run the app
|
||||||
CMD ["./deploy/start.sh"]
|
CMD ["./deploy/start.sh"]
|
||||||
|
@ -1,24 +1,30 @@
|
|||||||
FROM node:latest as build
|
FROM node:latest as build
|
||||||
|
|
||||||
|
# Change to the project directory
|
||||||
WORKDIR /usr/local/app
|
WORKDIR /usr/local/app
|
||||||
|
|
||||||
|
# Copy the project files to the container
|
||||||
COPY frontend /usr/local/app/
|
COPY frontend /usr/local/app/
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
RUN ls /usr/local/app/dist
|
|
||||||
|
|
||||||
|
|
||||||
FROM nginx:latest
|
FROM nginx:latest
|
||||||
|
|
||||||
|
# Copy the project files to the container
|
||||||
COPY --from=build /usr/local/app/dist/aktienbot /usr/share/nginx/html
|
COPY --from=build /usr/local/app/dist/aktienbot /usr/share/nginx/html
|
||||||
|
|
||||||
|
# Copy configuration files
|
||||||
COPY frontend/deploy/nginx.conf /etc/nginx
|
COPY frontend/deploy/nginx.conf /etc/nginx
|
||||||
COPY frontend/deploy deploy/
|
COPY frontend/deploy deploy/
|
||||||
|
|
||||||
|
# Change file permissions
|
||||||
RUN chmod +x ./deploy/healthcheck.sh
|
RUN chmod +x ./deploy/healthcheck.sh
|
||||||
|
|
||||||
|
# set healthcheck
|
||||||
HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"]
|
HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"]
|
||||||
|
|
||||||
|
# Expose webserver port
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
FROM python:3.10-slim
|
FROM python:3.10-slim
|
||||||
|
|
||||||
|
# Change the working directory to the root of the project
|
||||||
WORKDIR /srv/flask_app
|
WORKDIR /srv/flask_app
|
||||||
|
|
||||||
|
# Install the dependencies
|
||||||
COPY telegram_bot/requirements.txt /srv/flask_app/
|
COPY telegram_bot/requirements.txt /srv/flask_app/
|
||||||
|
|
||||||
RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location
|
RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location
|
||||||
|
|
||||||
|
# Copy the source code to the working directory
|
||||||
COPY telegram_bot /srv/flask_app
|
COPY telegram_bot /srv/flask_app
|
||||||
|
|
||||||
|
# Change file permissions
|
||||||
RUN chmod +x ./deploy/start.sh
|
RUN chmod +x ./deploy/start.sh
|
||||||
RUN chmod +x ./deploy/healthcheck.sh
|
RUN chmod +x ./deploy/healthcheck.sh
|
||||||
|
|
||||||
|
# TODO: Set healthcheck
|
||||||
# HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"]
|
# HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"]
|
||||||
|
|
||||||
EXPOSE 80
|
# Run the application
|
||||||
|
|
||||||
CMD ["./deploy/start.sh"]
|
CMD ["./deploy/start.sh"]
|
||||||
|
Loading…
Reference in New Issue
Block a user