-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
72 lines (53 loc) · 2.75 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM ghcr.io/prefix-dev/pixi:0.36.0 AS build
COPY . /app
WORKDIR /app
RUN pixi run build-wheel
RUN pixi run -e web postinstall-prod
RUN pixi shell-hook -e web > /shell-hook-web
RUN echo 'exec "$@"' >> /shell-hook-web
RUN pixi run -e worker postinstall-prod
RUN pixi shell-hook -e worker > /shell-hook-worker
RUN echo 'exec "$@"' >> /shell-hook-worker
#--------------------
FROM ubuntu:24.04 AS web
# only copy the production environment into prod container
COPY --from=build /app/.pixi/envs/web /app/.pixi/envs/web
COPY --from=build /shell-hook-web /shell-hook
RUN groupadd user && \
useradd --create-home --home-dir /home/user -g user -s /bin/bash user
COPY wortapp.py /app
COPY config/ /app/config
WORKDIR /app
#USER user
ENTRYPOINT ["/bin/bash", "/shell-hook"]
CMD ["gunicorn", "-b", "0.0.0.0:5000", "--access-logfile", "-", "'wortapp:create_app()'"]
#--------------------
FROM ubuntu:24.04 AS worker
# only copy the production environment into prod container
COPY --from=build /app/.pixi/envs/worker /app/.pixi/envs/worker
COPY --from=build /shell-hook-worker /shell-hook
RUN groupadd user && \
useradd --create-home --home-dir /home/user -g user -s /bin/bash user
COPY wortapp.py /app
COPY config/ /app/config
WORKDIR /app
USER user
# Configure sra-toolkit to disable cache
RUN mkdir ~/.ncbi
RUN echo '## auto-generated configuration file - DO NOT EDIT ##''' >> ~/.ncbi/user-settings.mkfg
RUN echo '' >> ~/.ncbi/user-settings.mkfg
RUN echo '/LIBS/GUID = "7737545d-30d4-4d05-875a-2c562df521d5"' >> ~/.ncbi/user-settings.mkfg
RUN echo '/config/default = "false"' >> ~/.ncbi/user-settings.mkfg
RUN echo '/libs/cloud/accept_aws_charges = "false"' >> ~/.ncbi/user-settings.mkfg
RUN echo '/libs/cloud/report_instance_identity = "true"' >> ~/.ncbi/user-settings.mkfg
RUN echo '/repository/user/ad/public/apps/file/volumes/flatAd = "."' >> ~/.ncbi/user-settings.mkfg
RUN echo '/repository/user/ad/public/apps/refseq/volumes/refseqAd = "."' >> ~/.ncbi/user-settings.mkfg
RUN echo '/repository/user/ad/public/apps/sra/volumes/sraAd = "."' >> ~/.ncbi/user-settings.mkfg
RUN echo '/repository/user/ad/public/apps/sraPileup/volumes/ad = "."' >> ~/.ncbi/user-settings.mkfg
RUN echo '/repository/user/ad/public/apps/sraRealign/volumes/ad = "."' >> ~/.ncbi/user-settings.mkfg
RUN echo '/repository/user/ad/public/root = "."' >> ~/.ncbi/user-settings.mkfg
RUN echo '/repository/user/default-path = "/root/ncbi"' >> ~/.ncbi/user-settings.mkfg
RUN echo '/repository/user/main/public/cache-disabled = "true"' >> ~/.ncbi/user-settings.mkfg
ENV RAYON_NUM_THREADS 3
ENTRYPOINT ["/bin/bash", "/shell-hook"]
CMD ["celery", "-A", "wort.blueprints.compute.tasks", "worker", "-Q", "compute_small,compute_medium,genomes", "--without-gossip", "--without-mingle", "--without-heartbeat", "-l", "INFO", "-c", "1"]