More docker stuff
This commit is contained in:
		
							
								
								
									
										13
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,11 +1,20 @@
 | 
				
			|||||||
FROM python:3
 | 
					FROM python:3
 | 
				
			||||||
EXPOSE 8000
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
ADD . /
 | 
					# Add files
 | 
				
			||||||
 | 
					RUN mkdir /site
 | 
				
			||||||
 | 
					WORKDIR /site
 | 
				
			||||||
 | 
					ADD . /site/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Set up configs
 | 
				
			||||||
RUN rm OACPL/settings.py
 | 
					RUN rm OACPL/settings.py
 | 
				
			||||||
RUN mv OACPL/settings.base.py OACPL/settings.py
 | 
					RUN mv OACPL/settings.base.py OACPL/settings.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Install packages
 | 
				
			||||||
RUN pip install -r requirements.txt
 | 
					RUN pip install -r requirements.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Initialize Django
 | 
				
			||||||
RUN python3 manage.py makemigrations --no-input
 | 
					RUN python3 manage.py makemigrations --no-input
 | 
				
			||||||
RUN python3 manage.py migrate --no-input
 | 
					RUN python3 manage.py migrate --no-input
 | 
				
			||||||
RUN python3 manage.py collectstatic --no-input
 | 
					RUN python3 manage.py collectstatic --no-input
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EXPOSE 8000
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,16 @@
 | 
				
			|||||||
version: 1
 | 
					version: '3'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
services:
 | 
					services:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  db:
 | 
					  db:
 | 
				
			||||||
    image: sqlite3
 | 
					    image: postgres
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  web:
 | 
					  web:
 | 
				
			||||||
    command: python3 manage.py runserver
 | 
					 | 
				
			||||||
    image: django
 | 
					 | 
				
			||||||
    build: .
 | 
					    build: .
 | 
				
			||||||
 | 
					    command: python3 manage.py runserver 0.0.0.0:8000
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - .:/code
 | 
				
			||||||
 | 
					    ports:
 | 
				
			||||||
 | 
					      - "8000:8000"
 | 
				
			||||||
 | 
					    depends_on:
 | 
				
			||||||
 | 
					      - db
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user