Add Dockerfile + nginx conf + add woodpecker CI file

This commit is contained in:
Joris Bertomeu
2024-09-26 15:57:25 +02:00
parent 023f263361
commit db1390e7a6
4 changed files with 132 additions and 0 deletions

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
# Build stage
FROM node:22 AS crawlflix-front-build
WORKDIR /app
# Add full context
ARG CONFIGURATION=production
ENV CONFIGURATION $CONFIGURATION
ARG build_number=0
ENV BUILD_NUMBER $build_number
COPY . .
# Install deps
RUN npm install -f
RUN npm install -g @angular/cli
RUN echo "export const version = { number: '${BUILD_NUMBER}' }" > ./src/version.ts
# Build dist
RUN ng build --configuration=${CONFIGURATION} --output-hashing=all
# Create stage
FROM nginx:latest
COPY --from=crawlflix-front-build /app/dist/crawlflix/browser/ /usr/share/nginx/html/
COPY /nginx.conf /etc/nginx/conf.d/default.conf