GPTcord/Dockerfile

31 lines
626 B
Docker

FROM node:18
WORKDIR /app
# Packages
COPY package*.json ./
RUN npm install -D
# Database schema
COPY schema.prisma .
RUN npx prisma generate
# Typescript compiling
COPY tsconfig.json .
COPY src ./src
COPY scripts ./scripts
RUN npx tsc
# Permissions for dist directory,
# so config.ts can be compiled there during runtime
# regardless of the user of the container
RUN chmod 777 dist
# Create a db directory for sqlite database file
# it is required because in order to write to sqlite file
# the directory must be writable
RUN mkdir /db
RUN chmod 777 /db
# Run the app
CMD ["node", "dist/src/index.js"]
STOPSIGNAL SIGINT