Skip to content

Commit

Permalink
feat: allow developer to deploy the application using Docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
SanyHe committed Jul 11, 2023
1 parent b26da93 commit c3737d9
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Stage 1: Build the frontend
FROM node:latest as frontend-builderge

# 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"]

0 comments on commit c3737d9

Please sign in to comment.