Skip to content

Commit 8d4cce1

Browse files
committed
Undo secrets changes
1 parent 1bd2b5d commit 8d4cce1

File tree

4 files changed

+15
-45
lines changed

4 files changed

+15
-45
lines changed

.github/workflows/build-docker.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ jobs:
3333
push: ${{ startsWith(github.ref, 'refs/tags/') }} # only push to ghcr.io on tags
3434
tags: ghcr.io/${{github.repository}}:latest
3535
file: docker/lnt.dockerfile
36-
target: llvm-lnt
3736
context: . # use the current directory as context, as checked out by actions/checkout -- needed for setuptools_scm

docker/compose.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@
1313
# The authentication token used to require authentication to
1414
# perform destructive actions.
1515

16-
name: llvm-lnt-prod
16+
name: llvm-lnt
1717

1818
services:
1919
webserver:
2020
container_name: webserver
2121
build:
2222
context: ../
2323
dockerfile: docker/lnt.dockerfile
24-
target: llvm-lnt-prod
2524
args:
2625
DB_USER: lntuser
2726
DB_HOST: dbserver
2827
DB_NAME: lnt.db
29-
secrets:
30-
- lnt-db-password
31-
- lnt-auth-token
28+
DB_PASSWORD: ${LNT_DB_PASSWORD}
29+
AUTH_TOKEN: ${LNT_AUTH_TOKEN}
3230
depends_on:
3331
- db
3432
deploy:
@@ -44,21 +42,13 @@ services:
4442
container_name: dbserver
4543
image: docker.io/postgres:18-alpine
4644
environment:
47-
- POSTGRES_PASSWORD_FILE=/run/secrets/lnt-db-password
45+
- POSTGRES_PASSWORD=${LNT_DB_PASSWORD}
4846
- POSTGRES_USER=lntuser
4947
- POSTGRES_DB=lnt.db
50-
secrets:
51-
- lnt-db-password
5248
volumes:
5349
- database:/var/lib/postgresql
5450

5551
volumes:
5652
instance:
5753
logs:
5854
database:
59-
60-
secrets:
61-
lnt-db-password:
62-
environment: "LNT_DB_PASSWORD"
63-
lnt-auth-token:
64-
environment: "LNT_AUTH_TOKEN"

docker/docker-entrypoint.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22

33
set -u
44

5-
if [ ! -f /run/secrets/lnt-db-password ]; then
6-
echo "Missing secret lnt-db-password"
7-
exit 1
8-
fi
9-
DB_PASSWORD="$(cat /run/secrets/lnt-db-password)"
10-
11-
if [ ! -f /run/secrets/lnt-auth-token ]; then
12-
echo "Missing secret lnt-auth-token"
13-
exit 1
14-
fi
15-
AUTH_TOKEN="$(cat /run/secrets/lnt-auth-token)"
16-
175
DB_PATH="postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}"
186

197
# Set up the instance the first time this gets run.

docker/lnt.dockerfile

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
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.
@@ -17,14 +11,14 @@
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
3024
RUN 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
4536
VOLUME /var/lib/lnt /var/log/lnt
4637

4738
# Set up the actual entrypoint that gets run when the container starts.
4839
COPY 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
5041
ENV DB_USER=${DB_USER}
5142
ENV DB_HOST=${DB_HOST}
5243
ENV DB_NAME=${DB_NAME}
44+
ENV DB_PASSWORD=${DB_PASSWORD}
45+
ENV AUTH_TOKEN=${AUTH_TOKEN}
5346
ENTRYPOINT ["docker-entrypoint.sh"]
5447
EXPOSE 8000

0 commit comments

Comments
 (0)