mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Docker cross-compilation with buildx (#2003)
* Build docker test * Change platform to build on amd64 * Put back buildplatform * Run frontend as separate docker task * Increase timeout * Update docs
This commit is contained in:
		
							parent
							
								
									8ef7789769
								
							
						
					
					
						commit
						c4da10b15f
					
				| @ -11,3 +11,4 @@ | ||||
| !README.md | ||||
| !frontend | ||||
| frontend/node_modules | ||||
| frontend/build | ||||
|  | ||||
| @ -112,9 +112,9 @@ You'll need: | ||||
|    - username: `admin` | ||||
|    - password: `unleash4all` | ||||
| 
 | ||||
| ### How to run Unleash with Docker | ||||
| ### How to run Unleash with Docker and Buildx | ||||
| 
 | ||||
| 1. Build a local docker image by running `docker build . -t unleash:local` | ||||
| 1. Build a local docker image by running `docker buildx build . -t unleash:local` | ||||
| 2. Create a network by running `docker network create unleash` | ||||
| 3. Start a Postgres database. Make sure to use the network you created in step 2. | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										15
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								Dockerfile
									
									
									
									
									
								
							| @ -1,7 +1,14 @@ | ||||
| ARG NODE_VERSION=16-alpine | ||||
| FROM node:$NODE_VERSION as builder | ||||
| 
 | ||||
| RUN echo "Debug - node version: $NODE_VERSION " | ||||
| FROM --platform=$BUILDPLATFORM node:$NODE_VERSION as frontend_builder | ||||
| 
 | ||||
| WORKDIR /frontend | ||||
| 
 | ||||
| COPY ./frontend /frontend | ||||
| 
 | ||||
| RUN yarn install --frozen-lockfile | ||||
| 
 | ||||
| FROM node:$NODE_VERSION as builder | ||||
| 
 | ||||
| WORKDIR /unleash | ||||
| 
 | ||||
| @ -9,7 +16,9 @@ COPY . /unleash | ||||
| 
 | ||||
| RUN yarn config set network-timeout 300000 | ||||
| 
 | ||||
| RUN yarn install --frozen-lockfile && yarn run local:package | ||||
| RUN yarn install --frozen-lockfile --ignore-scripts  && yarn run build && yarn run local:package | ||||
| 
 | ||||
| COPY --from=frontend_builder /frontend/build /unleash/build/frontend/build | ||||
| 
 | ||||
| WORKDIR /unleash/docker | ||||
| 
 | ||||
|  | ||||
| @ -33,7 +33,7 @@ | ||||
|     "copy-templates": "copyfiles -u 1 src/mailtemplates/**/*.mustache dist/", | ||||
|     "db-migrate": "db-migrate --migrations-dir ./src/migrations", | ||||
|     "lint": "eslint ./src", | ||||
|     "local:package": "del-cli --force build && mkdir build && cp -r dist docs CHANGELOG.md LICENSE README.md package.json build && mkdir -p build/frontend && cp -r frontend/build build/frontend", | ||||
|     "local:package": "del-cli --force build && mkdir build && cp -r dist docs CHANGELOG.md LICENSE README.md package.json build", | ||||
|     "prebuild:watch": "yarn run clean", | ||||
|     "build:watch": "tsc -w", | ||||
|     "prebuild": "yarn run clean", | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user