diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..31dc994 --- /dev/null +++ b/Dockerfile | |||
@@ -0,0 +1,27 @@ | |||
1 | FROM node:lts-alpine as build | ||
2 | |||
3 | WORKDIR /server-build | ||
4 | |||
5 | RUN ["apk", "add", "--no-cache", "python", "make", "gcc", "g++", "libc-dev", "sqlite-dev"] | ||
6 | |||
7 | COPY . /server-build | ||
8 | |||
9 | RUN ["npm", "ci", "--production", "--build-from-source", "--sqlite=/usr/local"] | ||
10 | |||
11 | FROM node:lts-alpine | ||
12 | |||
13 | WORKDIR /app | ||
14 | LABEL maintainer="xthursdayx" | ||
15 | |||
16 | ENV HOST=0.0.0.0 PORT=3333 DATA_DIR="/data" | ||
17 | |||
18 | RUN ["apk", "add", "--no-cache", "sqlite-libs", "curl", "su-exec"] | ||
19 | |||
20 | COPY --from=build /server-build /app | ||
21 | RUN ["npm", "i", "-g", "@adonisjs/cli"] | ||
22 | |||
23 | HEALTHCHECK --interval=5m --timeout=3s CMD curl -sSf http://localhost:${PORT}/health | ||
24 | |||
25 | COPY docker/entrypoint.sh /entrypoint.sh | ||
26 | COPY docker/.env /app/.env | ||
27 | CMD ["/entrypoint.sh"] | ||