-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
42 lines (32 loc) · 1.04 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
# Dockerfile for raptorapp
FROM continuumio/miniconda3:latest as build_image
# Install host dependencies
RUN apt update
RUN apt install libmariadb-dev -y
RUN apt install gcc -y
# Copy and install environment
COPY environment.yml environment.yml
RUN conda env create
# Install conda-pack:
RUN conda install -c conda-forge conda-pack
# Use conda-pack to create a standalone enviornment
RUN conda-pack -n djangoWork -o /tmp/env.tar && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar
# Extract standalone environment to /venv/
RUN /venv/bin/conda-unpack
# The Runtime Image
FROM debian:buster AS runtime_image
# Install mariadb dev tools
RUN apt update
RUN apt install libmariadb-dev -y
# Copy /venv from the previous stage:
COPY --from=build_image /venv /venv
# Copy project files
COPY . /raptorWebApp
# Define entrypoint
RUN chmod +x+r -R /raptorWebApp/docker/init
RUN chmod +x+r /venv/bin/activate
SHELL ["/bin/bash", "-c"]
ENTRYPOINT source /venv/bin/activate && \
./raptorWebApp/docker/init/run-raptorapp-prod.sh