websoft9/docker/w9apphub/Dockerfile

49 lines
1.3 KiB
Docker
Raw Normal View History

2023-02-21 14:21:53 +08:00
FROM python:3.10-slim
LABEL maintainer="Websoft9<help@websoft9.com>"
2023-09-18 10:52:08 +08:00
LABEL version="0.0.1"
2023-03-24 15:32:38 +08:00
2023-09-18 17:13:15 +08:00
ENV LIBRARY_VERSION=v0.5.4
2023-02-21 14:21:53 +08:00
2023-09-18 17:13:15 +08:00
# RUN mkdir /usr/src/app/config
WORKDIR /usr/websoft9
2023-09-18 10:52:08 +08:00
2023-04-04 09:25:13 +08:00
RUN apt update
2023-09-18 17:13:15 +08:00
RUN apt install -y supervisor wget git zip
RUN wget https://github.com/Websoft9/docker-library/archive/refs/tags/$LIBRARY_VERSION.zip -O /usr/websoft9/library.zip
RUN unzip library.zip
RUN mkdir credentials
RUN echo "This folder stored the credentials of other services that apphub will connect" > credentials/readme
2023-09-19 09:02:56 +08:00
# Media and master data from Contentful
RUN wget --depth=1 https://github.com/Websoft9/plugin-appstore
RUN mv -f plugin-appstore/data ./media
2023-09-18 17:13:15 +08:00
# Copy source and install pip dpendencies
# Todo: add virtualenv for Python install
COPY ../../appmanage_new ./apphub
RUN pip install -r apphub/requirements.txt
2023-04-06 13:07:21 +08:00
2023-09-18 17:13:15 +08:00
# supervisor
2023-04-04 09:51:08 +08:00
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
2023-09-18 17:13:15 +08:00
RUN chmod +r /etc/supervisor/conf.d/supervisord.conf
# entrypoint
COPY config/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
VOLUME /usr/websoft9/apphub/logs
VOLUME /usr/websoft9/apphub/src/conf
VOLUME /usr/websoft9/media
# Clean
2023-09-19 09:02:56 +08:00
RUN rm -rf apphub/docs apphub/tests library.zip plugin-appstore
2023-02-21 14:21:53 +08:00
2023-05-19 15:41:50 +08:00
# Expose the port in which the application will be deployed
2023-09-18 17:13:15 +08:00
EXPOSE 8080
ENTRYPOINT [/entrypoint.sh]