-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
44 lines (33 loc) · 1.32 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
FROM continuumio/miniconda3:latest
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PATH=/opt/conda/envs/gsp_api/bin:$PATH API_PREFIX=/api
# For Development On Analytics Only:
# ENV AWS_ACCESS_KEY_ID=
# ENV AWS_SECRET_ACCESS_KEY=
# ENV AWS_LOG_GROUP_NAME=
# ENV AWS_LOG_STREAM_NAME=
# ENV AWS_REGION=
RUN mkdir /var/uwsgi
RUN apt-get update -qq && apt-get install -yqq supervisor vim
COPY ./environment.yml ./startup.sh ./
RUN conda config --set channel_priority strict && \
conda config --add channels conda-forge && \
conda env create -f environment.yml && \
echo "conda activate gsp_api" >> ~/.bashrc
RUN mkdir -p /mnt/output/forecasts && \
mkdir -p /mnt/output/era-interim && \
mkdir -p /mnt/output/era-5 && \
mkdir -p /mnt/output/forecast-records
# COPY ./sample_data/forecasts /mnt/output/forecasts
# COPY ./sample_data/era-interim /mnt/output/era-interim
# COPY ./sample_data/era-5 /mnt/output/era-5
# COPY ./sample_data/forecast-records /mnt/output/forecast-records
# Copy API code
COPY ./GSP_API /app/GSP_API/
COPY ./supervisord.conf /etc/supervisor/conf.d/uwsgi.conf
# startup.sh is a helper script
RUN chmod +x /startup.sh
# Expose the port that is to be used when calling your API
EXPOSE 80
HEALTHCHECK --interval=1m --timeout=3s --start-period=20s \
CMD curl -f http://localhost/ || exit 1
ENTRYPOINT [ "/startup.sh" ]