forked from PrairieLearn/PrairieLearn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
23 lines (19 loc) · 816 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
FROM prairielearn/centos7-plbase
# Install Python/NodeJS dependencies before copying code to limit download size
# when code changes.
COPY package.json package-lock.json /PrairieLearn/
RUN cd /PrairieLearn \
&& npm ci \
&& npm --force cache clean
# NOTE: Modify .dockerignore to whitelist files/directories to copy.
COPY . /PrairieLearn/
# set up PrairieLearn and run migrations to initialize the DB
RUN chmod +x /PrairieLearn/docker/init.sh \
&& mv /PrairieLearn/docker/config.json /PrairieLearn \
&& mkdir /course \
&& /PrairieLearn/docker/start_postgres.sh \
&& cd /PrairieLearn \
&& node server.js --migrate-and-exit \
&& /PrairieLearn/docker/start_postgres.sh stop
HEALTHCHECK CMD curl --fail http://localhost:3000/pl/webhooks/ping || exit 1
CMD /PrairieLearn/docker/init.sh