Added Dockerfiles and scripts to run the dev build of Colossus through Docker
This commit is contained in:
		
							
								
								
									
										25
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					# PHP composer to get dependencies
 | 
				
			||||||
 | 
					FROM composer:2.5 as COMPOSER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /usr/src/colossus/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY composer.* /usr/src/colossus/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Install dependencies
 | 
				
			||||||
 | 
					RUN composer install
 | 
				
			||||||
 | 
					RUN composer update
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Actual PHP runtime
 | 
				
			||||||
 | 
					FROM php:8.2-cli
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /usr/src/colossus/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY --from=COMPOSER /usr/src/colossus/vendor/ /usr/src/colossus/vendor/
 | 
				
			||||||
 | 
					COPY . /usr/src/colossus/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					VOLUME /usr/src/colossus/vendor/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EXPOSE 8080
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Run the app
 | 
				
			||||||
 | 
					CMD [ "php", "-S", "0.0.0.0:8080", "-t", "public/", "public/index.php" ]
 | 
				
			||||||
							
								
								
									
										13
									
								
								Dockerfile.grunt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Dockerfile.grunt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
				
			|||||||
 | 
					# Node.js runtime
 | 
				
			||||||
 | 
					FROM node:20
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /usr/src/colossus/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY package.* /usr/src/colossus/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN npm install
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					VOLUME /usr/src/colossus/node_modules/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Run the app
 | 
				
			||||||
 | 
					CMD [ "npm", "run", "grunt" ]
 | 
				
			||||||
@@ -23,7 +23,7 @@ a{
 | 
				
			|||||||
  left: 0;
 | 
					  left: 0;
 | 
				
			||||||
  width: 100%;
 | 
					  width: 100%;
 | 
				
			||||||
  height: $nav-height;
 | 
					  height: $nav-height;
 | 
				
			||||||
  background: navy;
 | 
					  background: $primary-color;
 | 
				
			||||||
  color: #eee;
 | 
					  color: #eee;
 | 
				
			||||||
  font-size: 2rem;
 | 
					  font-size: 2rem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								bin/docker-build.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										4
									
								
								bin/docker-build.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docker build -t colossus-php .
 | 
				
			||||||
 | 
					docker build -t colossus-grunt -f Dockerfile.grunt .
 | 
				
			||||||
							
								
								
									
										4
									
								
								bin/docker-run.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										4
									
								
								bin/docker-run.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docker run --rm -d -w "/usr/src/colossus" -v "$(pwd):/usr/src/colossus" -p 8080:8080 --name colossus-php colossus-php
 | 
				
			||||||
 | 
					docker run --rm -d -w "/usr/src/colossus" -v "$(pwd):/usr/src/colossus" --name colossus-grunt colossus-grunt npm run grunt watch
 | 
				
			||||||
		Reference in New Issue
	
	Block a user