-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (29 loc) · 900 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
FROM node:22-alpine as builder
LABEL authors="tkdbb84"
WORKDIR /home/node/
USER node
COPY --chown=node:node package* ./
RUN npm ci --omit=dev
COPY --chown=node:node . ./
RUN npm run build
FROM node:22-alpine as cotbot
LABEL authors="tkdbb84"
WORKDIR /home/node/
USER node
COPY --chown=node:node --from=builder /home/node/dist ./dist
COPY --chown=node:node --from=builder /home/node/node_modules ./node_modules
COPY --chown=node:node --from=builder /home/node/package* ./
ENV TYPEORM_CONNECTION=mysql
ENV TYPEORM_HOST=db
ENV TYPEORM_DRIVER_EXTRA='{"charset": "utf8mb4"}'
ENV TYPEORM_SYNCHRONIZE=1
ENV TYPEORM_LOGGING=0
ENV TYPEORM_ENTITIES="entity/*.js,modules/**/entity/*.js"
ENV TYPEORM_PORT=3306
ENV TYPEORM_USERNAME=cotbot
ENV TYPEORM_DATABASE=cotbot
ENV REDIS_HOST=redis
ENV REDIS_PORT=6379
ENV TYPEORM_PASSWORD="localhost-password"
ENV NODE_ENV=localhost
CMD ["node", "dist/index.js"]