-
Notifications
You must be signed in to change notification settings - Fork 29
/
Dockerfile
39 lines (28 loc) · 927 Bytes
/
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
# Stage 1: Build the frontend
FROM node:latest as frontend-builder
# Set the working directory
WORKDIR /app
# Install frontent dependencies
COPY geochemistrypi/frontend/package.json /app/
RUN yarn install
# Stage 2: Build the backend
FROM python:3.9-slim AS backend-builder
# Set the working directory
WORKDIR /app
# Install backend dependencies
COPY requirements/production.txt /app/
RUN pip install -r production.txt
# Special case for Debian OS, update package lists and install Git and Node.js
RUN apt-get update && apt-get install -y libgomp1 git
RUN apt-get update && apt-get install -y nodejs
RUN apt-get update && apt-get install -y npm
# Install Yarn
RUN npm install -g yarn
# Copy the rest of the code
COPY . .
# Expose the port
EXPOSE 8000 3001
# Mount the volume
VOLUME /app
# Dummy CMD to prevent container from exiting immediately
CMD ["tail", "-f", "/dev/null"]