-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
29 lines (24 loc) · 901 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
# ------------------------------------------------------
# Dockerfile
# ------------------------------------------------------
# image: typescript-node-starter
# tag: latest
# name: minddocdev/typescript-node-starter
# repo:
# how-to: docker build -t minddocdev/typescript-node-starter:latest .
# Requires: node:alpine
# authors: [email protected]
# ------------------------------------------------------
FROM node:11.13-alpine
LABEL maintainer="[email protected]"
# Create app directory and install production dependencies
WORKDIR /usr/src/app
COPY tsconfig.json package.json package-lock.json ./
RUN npm install --only=production
# Copy src files (Use .dockerignore to exclude non essential)
COPY src/ ./src
# Set permissions for the node user
RUN chown -R node:node .
USER node
# Run ts-node with src/server.ts entry point
CMD ["npm", "start"]