Add docker file

This commit is contained in:
2024-01-21 11:30:02 +08:00
parent c0d86d3da5
commit b8b1192d88
8 changed files with 133 additions and 35 deletions

34
Dockerfile Normal file
View File

@@ -0,0 +1,34 @@
FROM denoland/deno:latest
ARG DENO_DEPLOYMENT_ID
WORKDIR /app
COPY ./components ./components
COPY ./islands ./islands
COPY ./page ./page
COPY ./routes ./routes
COPY ./server ./server
COPY ./static/*.css ./static/
COPY ./static/*.ts ./static/
COPY ./static/*.ico ./static/
COPY ./static/*.svg ./static/
COPY ./tasks ./tasks
COPY ./thumbnail ./thumbnail
COPY ./translation ./translation
COPY ./utils ./utils
COPY ./*.ts ./
COPY ./deno.json ./
COPY ./import_map.json ./
COPY ./LICENSE ./
RUN deno task fetch
ENV DENO_DEPLOYMENT_ID=${DENO_DEPLOYMENT_ID}
RUN deno task server-build
EXPOSE 8000
ENTRYPOINT deno
CMD ["task", "server"]
HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \
CMD curl -Lk -fsS http://localhost:8000/api/health_check || exit 1