Skip to content

Commit

Permalink
Merge pull request #32 from shotnothing/simin-docker
Browse files Browse the repository at this point in the history
Docker set up
  • Loading branch information
shotnothing authored Apr 6, 2024
2 parents 3164fe9 + 4bedadc commit 13a168f
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# local env files
.env*.local
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'

services:
backend:
build: ./server
command: python ./server/manage.py runserver 0.0.0.0:8000
volumes:
- .:/volume
ports:
- "8000:8000"

frontend:
build: ./webapp
ports:
- "3000:3000"
15 changes: 13 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Use the official Python 3 image as base
FROM python:3
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Set environment variables to optimize Python environment
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Set the working directory inside the container
WORKDIR /volume

# Copy the requirements.txt file from the local filesystem into the container's working directory
COPY requirements.txt /volume/

# Install Python dependencies from requirements.txt using pip
RUN pip install -r requirements.txt

# Copy the rest of the application files from the local filesystem into the container's working directory
COPY . /volume/
8 changes: 0 additions & 8 deletions server/docker-compose.yaml

This file was deleted.

23 changes: 23 additions & 0 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use the official Node.js image as the base
FROM node:20-alpine

# Set the working directory inside the container
WORKDIR /src/app

# Copy package.json and package-lock.json to the container
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the Next.js application
RUN npm run build

# Expose the port Next.js is running on
EXPOSE 3000

# Command to run the Next.js application
CMD ["npm", "start"]

0 comments on commit 13a168f

Please sign in to comment.