-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
49 lines (38 loc) · 1.4 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
FROM ubuntu:22.04
RUN apt-get update && apt-get -y upgrade \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
wget \
parallel \
&& rm -rf /var/lib/apt/lists/*
ENV HOME /home/cc
RUN groupadd -r cc && useradd -r -g cc cc
RUN mkdir ${HOME} && chown cc:cc ${HOME}
USER cc
WORKDIR ${HOME}
ENV PATH="${HOME}/miniconda3/bin:${PATH}"
ARG PATH="${HOME}/miniconda3/bin:${PATH}"
RUN pwd && whoami && ls -la . && wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir ${HOME}/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh \
&& echo "Running $(conda --version)" \
&& conda init bash \
&& . ${HOME}/.bashrc \
&& conda update conda
Copy --chown=cc:cc . cc_corpus
RUN . ${HOME}/.bashrc \
&& conda install python=3.11 pip \
&& export CFLAGS="-Wno-narrowing" \
&& pip install -e cc_corpus
WORKDIR "${HOME}/cc_corpus"
RUN cp app/config_docker.yaml app/config.yaml
RUN echo '#!/bin/bash' >> launch_app.sh \
&& echo 'source ~/miniconda3/etc/profile.d/conda.sh' >> launch_app.sh \
&& echo 'uvicorn app.main:app --host 0.0.0.0 --port 8000' >> launch_app.sh
RUN chmod +x launch_app.sh
EXPOSE 8000
# The port used by uvicorn for the webserver.
ENTRYPOINT ["/bin/bash", "-l", "-c"]
CMD ["./launch_app.sh"]