fix(backend): Zet Docker terug
This commit is contained in:
		
							parent
							
								
									e55b96bc08
								
							
						
					
					
						commit
						f537830b15
					
				
					 1 changed files with 28 additions and 6 deletions
				
			
		|  | @ -1,13 +1,12 @@ | ||||||
| FROM node:22 | FROM node:22 AS build-stage | ||||||
| 
 | 
 | ||||||
| WORKDIR /app/dwengo | WORKDIR /app/dwengo | ||||||
| 
 | 
 | ||||||
| COPY ./backend/i18n ./i18n |  | ||||||
| 
 |  | ||||||
| # Install dependencies | # Install dependencies | ||||||
| 
 | 
 | ||||||
| COPY package*.json ./ | COPY package*.json ./ | ||||||
| COPY backend/package.json ./backend/ | COPY backend/package.json ./backend/ | ||||||
|  | # Backend depends on common | ||||||
| COPY common/package.json ./common/ | COPY common/package.json ./common/ | ||||||
| 
 | 
 | ||||||
| RUN npm install --silent | RUN npm install --silent | ||||||
|  | @ -15,14 +14,37 @@ RUN npm install --silent | ||||||
| # Build the backend | # Build the backend | ||||||
| 
 | 
 | ||||||
| # Root tsconfig.json | # Root tsconfig.json | ||||||
| COPY tsconfig.json ./ | COPY tsconfig.json tsconfig.build.json ./ | ||||||
| 
 | 
 | ||||||
| COPY backend ./backend | COPY backend ./backend | ||||||
| COPY common ./common | COPY common ./common | ||||||
| COPY docs ./docs | COPY docs ./docs | ||||||
| 
 | 
 | ||||||
| RUN npm run build --workspace=common | RUN npm run build | ||||||
| RUN npm run build --workspace=backend | 
 | ||||||
|  | FROM node:22 AS production-stage | ||||||
|  | 
 | ||||||
|  | WORKDIR /app/dwengo | ||||||
|  | 
 | ||||||
|  | # Copy static files | ||||||
|  | 
 | ||||||
|  | COPY ./backend/i18n ./i18n | ||||||
|  | 
 | ||||||
|  | # Copy built files | ||||||
|  | 
 | ||||||
|  | COPY --from=build-stage /app/dwengo/common/dist ./common/dist | ||||||
|  | COPY --from=build-stage /app/dwengo/backend/dist ./backend/dist | ||||||
|  | 
 | ||||||
|  | COPY package*.json ./ | ||||||
|  | COPY backend/package.json ./backend/ | ||||||
|  | # Backend depends on common | ||||||
|  | COPY common/package.json ./common/ | ||||||
|  | 
 | ||||||
|  | RUN npm install --silent --only=production | ||||||
|  | 
 | ||||||
|  | COPY ./docs ./docs | ||||||
|  | COPY ./backend/i18n ./backend/i18n | ||||||
|  | COPY ./backend/.env ./backend/.env | ||||||
| 
 | 
 | ||||||
| EXPOSE 3000 | EXPOSE 3000 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Reference in a new issue