-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
52 lines (42 loc) · 1.36 KB
/
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
46
47
48
49
50
51
52
# might fix this? https://github.com/parcel-bundler/parcel/issues/6735
FROM node:16-bullseye as frontbuild
WORKDIR /usr/src/app/frontend
COPY ./frontend/package*.json ./
RUN npm ci --only=production
COPY ./frontend/. .
COPY ./shared ../shared
RUN npm run build && bash -O extglob -c 'rm -rfv !("dist")'
WORKDIR ../
RUN bash -O extglob -c 'rm -rfv !("frontend")'
FROM node:16-alpine as backexceptwithoutfrontend
WORKDIR /usr/src/app
COPY ./backend/package*.json ./
RUN npm ci --only=production
COPY ./backend ./
RUN rm -rfv frontend && unlink src/shared
COPY ./shared src/shared
FROM backexceptwithoutfrontend
WORKDIR /usr/src/app
COPY --from=frontbuild /usr/src/app/frontend ./frontend
COPY ./dockerentry.sh .
#ENV PORT=8080
#ENV TYPEORM_HOST=localhost
#ENV TYPEORM_USERNAME=root
#ENV TYPEORM_PASSWORD=admin
#ENV TYPEORM_DATABASE=test
#ENV TYPEORM_PORT=3000
ENV DATA_DIR=data\
TYPEORM_CONNECTION=mariadb\
TYPEORM_SYNCHRONIZE=false\
TYPEORM_LOGGING=false\
TYPEORM_ENTITIES=src/entity/**/*.ts\
TYPEORM_ENTITIES_DIR=src/entity\
TYPEORM_MIGRATIONS=src/migration/**/*.ts\
TYPEORM_MIGRATIONS_DIR=src/migration\
TYPEORM_SUBSCRIBERS=src/subscriber/**/*.ts\
TYPEORM_SUBSCRIBERS_DIR=src/subscriber\
TYPEORM_DRIVER_EXTRA='{"charset": "utf8mb4"}'\
NODE_ENV=production
#EXPOSE 8080
RUN ["chmod", "+x", "./dockerentry.sh"]
CMD [ "./dockerentry.sh" ]