Fixed dockerfile, added a docker-compose.yml, added db init function to run on every startup
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -1,7 +1,7 @@
|
||||
FROM debian:12 AS base
|
||||
WORKDIR /opt/app
|
||||
RUN apt-get update && \
|
||||
apt-get install -y curl unzip ca-certificates python3 python3-pip && \
|
||||
apt-get install -y curl unzip cron ca-certificates python3 python3-pip && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
# install BunJs
|
||||
RUN curl -fsSL https://bun.com/install | bash
|
||||
@@ -38,7 +38,12 @@ FROM base AS release
|
||||
COPY --from=install /temp/prod/node_modules node_modules
|
||||
COPY --from=prerelease /opt/app/src/app.ts .
|
||||
COPY --from=prerelease /opt/app/package.json .
|
||||
COPY --from=prerelease /opt/app/entrypoint.sh .
|
||||
COPY Crontab /etc/cron.d/
|
||||
RUN chmod 0644 /etc/cron.d/Crontab
|
||||
# USER bun
|
||||
RUN touch /var/log/cron.log
|
||||
# RUN chmod +x entrypoint.sh
|
||||
# ENTRYPOINT ["./entrypoint.sh"]
|
||||
VOLUME ["/opt/app/data/db"]
|
||||
# run the app
|
||||
USER bun
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
CMD cron && tail -f /var/log/cron.log
|
||||
Reference in New Issue
Block a user