1- #  This Dockerfile defines a basic 'llvm-lnt' image that contains an installed
2- #  copy of LNT. That image can be built and run with:
3- # 
4- #    $ docker build --file docker/lnt.dockerfile --target llvm-lnt .
5- #    $ docker run -it <sha> /bin/sh
6- # 
7- #  It also defines a 'llvm-lnt-prod' image which is set up to run a production
8- #  LNT server. This image is intended to be built from a Docker Compose file,
9- #  as it requires additional information like secrets and build arguments:
1+ #  This Dockerfile defines an image that contains a production LNT server.
2+ #  This image is intended to be built from a Docker Compose file, as it
3+ #  requires additional information passed as build arguments:
104# 
115#    ARG DB_USER
126#      The username to use for logging into the database.
1711#    ARG DB_NAME
1812#      The name of the database on the server.
1913# 
20- #    secret: lnt-db-password 
14+ #    ARG DB_PASSWORD 
2115#      The password to use for logging into the database.
2216# 
23- #    secret: lnt-auth-token 
24- #      The authentication token used to require authentication to 
25- #      perform destructive actions.
17+ #    ARG AUTH_TOKEN 
18+ #      The authentication token used to require authentication
19+ #      to  perform destructive actions.
2620
27- FROM  python:3.10-alpine AS llvm-lnt 
21+ FROM  python:3.10-alpine
2822
2923#  Install dependencies
3024RUN  apk update \
@@ -38,17 +32,16 @@ RUN --mount=type=bind,source=.,target=./lnt-source \
3832    pip3 install -r requirements.server.txt && apk --purge del .build-deps && \
3933    rm -rf /tmp/lnt-src
4034
41- 
42- FROM  llvm-lnt AS llvm-lnt-prod
43- 
4435#  Prepare volumes that will be used by the server
4536VOLUME  /var/lib/lnt /var/log/lnt
4637
4738#  Set up the actual entrypoint that gets run when the container starts.
4839COPY  docker/docker-entrypoint.sh docker/lnt-wait-db /usr/local/bin/
49- ARG  DB_USER DB_HOST DB_NAME
40+ ARG  DB_USER DB_HOST DB_NAME DB_PASSWORD AUTH_TOKEN 
5041ENV  DB_USER=${DB_USER}
5142ENV  DB_HOST=${DB_HOST}
5243ENV  DB_NAME=${DB_NAME}
44+ ENV  DB_PASSWORD=${DB_PASSWORD}
45+ ENV  AUTH_TOKEN=${AUTH_TOKEN}
5346ENTRYPOINT  ["docker-entrypoint.sh" ]
5447EXPOSE  8000
0 commit comments