docker
This commit is contained in:
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
FROM node:22-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
COPY apps/api/package.json apps/api/package.json
|
||||
COPY apps/web/package.json apps/web/package.json
|
||||
RUN npm ci
|
||||
|
||||
FROM deps AS build
|
||||
COPY tsconfig.base.json ./
|
||||
COPY eslint.config.mjs ./
|
||||
COPY apps/api apps/api
|
||||
COPY apps/web apps/web
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine AS runtime
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV API_PORT=3000
|
||||
ENV WEB_PORT=8080
|
||||
ENV API_BASE_URL=http://localhost:3000
|
||||
|
||||
RUN apk add --no-cache nginx
|
||||
|
||||
COPY --from=deps /app/node_modules node_modules
|
||||
COPY --from=build /app/apps/api/dist api
|
||||
COPY --from=build /app/apps/web/dist/web/browser /usr/share/nginx/html
|
||||
COPY apps/api/package.json package.json
|
||||
COPY docker/single-container.nginx.conf /etc/nginx/http.d/default.conf
|
||||
COPY docker/start-single-container.sh /usr/local/bin/start-ldap-portal
|
||||
RUN chmod +x /usr/local/bin/start-ldap-portal \
|
||||
&& mkdir -p /run/nginx /var/log/nginx
|
||||
|
||||
EXPOSE 3000 8080
|
||||
CMD ["start-ldap-portal"]
|
||||
Reference in New Issue
Block a user