-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (38 loc) · 1.36 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
# ==================================== BASE ====================================
ARG INSTALL_PYTHON_VERSION=${INSTALL_PYTHON_VERSION:-3.7}
FROM condaforge/mambaforge AS base
RUN apt-get update
RUN apt-get install -y \
gcc \
wget
RUN mamba install -c ome omero-py
ARG INSTALL_NODE_VERSION=${INSTALL_NODE_VERSION:-12}
RUN mamba install nodejs=${INSTALL_NODE_VERSION}
WORKDIR /app
COPY requirements requirements
COPY . .
RUN useradd -m sid
RUN chown -R sid:sid /app
USER sid
RUN echo "python version: " && which python
RUN python -c "import sys; print(sys.version)"
ENV PATH="/home/sid/.local/bin:${PATH}"
RUN npm install
# ================================= DEVELOPMENT ================================
FROM base AS development
RUN pip install --user -r requirements/dev.txt
EXPOSE 2992
EXPOSE 5020
CMD [ "npm", "start" ]
# ================================= PRODUCTION =================================
FROM base AS production
RUN pip install --user -r requirements/prod.txt
COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY supervisord_programs /etc/supervisor/conf.d
EXPOSE 5020
ENTRYPOINT ["/bin/bash", "shell_scripts/supervisord_entrypoint.sh"]
CMD ["-c", "/etc/supervisor/supervisord.conf"]
# =================================== MANAGE ===================================
FROM base AS manage
RUN pip install --user -r requirements/dev.txt
ENTRYPOINT [ "flask" ]