-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (32 loc) · 876 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Build stage
FROM node:18-alpine as builder
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY tsconfig.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY src/ ./src/
# Build TypeScript code
RUN npm run build
# Production stage
FROM node:18-alpine
WORKDIR /app
# Copy package files and install production dependencies
COPY package*.json ./
RUN npm ci --production
# Copy built files from builder stage
COPY --from=builder /app/dist ./dist
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
ENV TAPIS_JWKS_URI=https://tacc.tapis.io/v3/tenants/tacc
ENV TAPIS_TOKEN_ISSUER=https://tacc.tapis.io/v3/tokens
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost:3000/health || exit 1
# Run the application
CMD ["node", "dist/server.js"]