-
Notifications
You must be signed in to change notification settings - Fork 44
/
Dockerfile
27 lines (22 loc) · 1.02 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
FROM python:3.11-slim
# Prevent writing .pyc files on the import of source modules
# and set unbuffered mode to ensure logging outputs
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /app
# Copy repo contents
COPY pyproject.toml requirements.txt requirements-server.txt LICENSE README.md .docker/run.sh ./
COPY optimade ./optimade
COPY providers/src/links/v1/providers.json ./optimade/server/data/
RUN apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -U pip setuptools wheel flit \
&& pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements.txt -r requirements-server.txt \
&& pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org .[server]
# Setup server configuration
ARG CONFIG_FILE=optimade_config.json
COPY ${CONFIG_FILE} ./optimade_config.json
ENV OPTIMADE_CONFIG_FILE=/app/optimade_config.json
# Run app
EXPOSE 5000
ENTRYPOINT [ "/app/run.sh" ]