|
|
FROM ubuntu:latest |
|
|
|
|
|
WORKDIR /opt/app |
|
|
|
|
|
ENV TZ Asia/Shanghai |
|
|
|
|
|
|
|
|
RUN sed -i s@/archive.ubuntu.com/@/mirrors.ustc.edu.cn/@g /etc/apt/sources.list |
|
|
RUN sed -i s@/security.ubuntu.com/@/mirrors.ustc.edu.cn/@g /etc/apt/sources.list |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y wget tar gzip python3 python3-pip curl bash tzdata ca-certificates --no-install-recommends |
|
|
RUN apt-get install -y python3.12-venv --no-install-recommends |
|
|
|
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo Asia/Shanghai > /etc/timezone |
|
|
|
|
|
|
|
|
COPY app1 /opt/app/app1 |
|
|
COPY app.ini /opt/app/app.ini |
|
|
|
|
|
|
|
|
RUN mkdir -p /opt/app/app_data |
|
|
RUN chmod -R 755 /opt/app |
|
|
|
|
|
|
|
|
RUN useradd -u 1000 -ms /bin/bash www-data || true |
|
|
|
|
|
|
|
|
RUN chown -R www-data:www-data /opt/app |
|
|
|
|
|
|
|
|
RUN chown -R www-data:www-data /opt/app/app_data |
|
|
|
|
|
|
|
|
RUN chmod -R 775 /opt/app |
|
|
|
|
|
|
|
|
ENV VIRTUAL_ENV=/opt/venv |
|
|
RUN python3 -m venv $VIRTUAL_ENV |
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
|
|
RUN pip3 install --no-cache-dir requests webdavclient3 |
|
|
|
|
|
|
|
|
COPY sync_data.sh /opt/app/ |
|
|
RUN chmod +x /opt/app/sync_data.sh |
|
|
RUN chmod +x /opt/app/app1 |
|
|
|
|
|
|
|
|
EXPOSE 5432 |
|
|
|
|
|
|
|
|
CMD ["/bin/bash", "-c", "/opt/app/sync_data.sh; sleep 10; ./app1 -c /opt/app/app.ini"] |
|
|
|
|
|
|
|
|
|