Skip to content

Commit d3948c4

Browse files
committed
cleanup / notes
1 parent 42ca958 commit d3948c4

File tree

4 files changed

+25
-20
lines changed

4 files changed

+25
-20
lines changed

Justfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
set shell := ["bash", "-Eeuo", "pipefail", "-c"]
22
set ignore-comments
3+
set dotenv-load := true
4+
set dotenv-override := true
5+
6+
# some environment variables that are needed for _local_ commands
7+
# these are defaults that can be overwritten in your local .env file
8+
export DOCSRS_INCLUDE_DEFAULT_TARGETS := env("DOCSRS_INCLUDE_DEFAULT_TARGETS", "false")
9+
export DOCSRS_LOG := env("DOCSRS_LOG", "docs_rs=debug,rustwide=info")
10+
export RUST_BACKTRACE := env("RUST_BACKTRACE", "1")
11+
export DOCSRS_PREFIX := env("DOCSRS_PREFIX", "ignored/cratesfyi-prefix")
12+
13+
# database & s3 settings for local testing, to connect to the DB & S3/minio instance
14+
# configured in docker-compose.yml
15+
export DOCSRS_DATABASE_URL := env("DOCSRS_DATABASE_URL", "postgresql://cratesfyi:password@localhost:15432")
16+
export AWS_ACCESS_KEY_ID := env("AWS_ACCESS_KEY_ID", "cratesfyi")
17+
export AWS_SECRET_ACCESS_KEY := env("AWS_SECRET_ACCESS_KEY", "secret_key")
18+
export S3_ENDPOINT := env("S3_ENDPOINT", "http://localhost:9000")
19+
320

421
# List available commands
522
_default:
@@ -9,3 +26,6 @@ import 'justfiles/cli.just'
926
import 'justfiles/utils.just'
1027
import 'justfiles/services.just'
1128
import 'justfiles/testing.just'
29+
30+
psql:
31+
psql $DOCSRS_DATABASE_URL

NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
- unsure if the prefix mount should also be a docker volume, for performance.
1818
Not sure how often we actually have to look at the contents?
1919

20+
- no apt-get upgrade in docker build, typically you should rely on the
21+
base-image to be up-to-date. Rebuild every night.
22+
- focus right now: docker images for production and local manual testing
23+
- not yet: running build-tests locally
24+
2025
## TODO
2126

2227
- what is better, buildx cache mounts or just layer caching?

dockerfiles/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ RUN apt-get update \
105105

106106
WORKDIR /srv/docsrs
107107

108-
# Tini is a small init binary to properly handle signals
109108
ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "--"]
110109
CMD ["start-web-server", "0.0.0.0:3000"]
111110

@@ -141,7 +140,6 @@ RUN apt-get update \
141140
&& apt-get clean \
142141
&& rm -rf /var/lib/apt/lists/*
143142

144-
# Tini is a small init binary to properly handle signals
145143
ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "--"]
146144
CMD ["start-build-server", "0.0.0.0:3000"]
147145

@@ -167,7 +165,6 @@ RUN apt-get update \
167165
&& apt-get clean \
168166
&& rm -rf /var/lib/apt/lists/*
169167

170-
# Tini is a small init binary to properly handle signals
171168
ENTRYPOINT ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "--"]
172169
CMD ["start-registry-watcher", "0.0.0.0:3000", "--repository-stats-updater=enabled", "--cdn-invalidator=enabled", "--queue-rebuilds=enabled"]
173170

justfiles/testing.just

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
# just commands for CI & local development
2-
set dotenv-load := true
3-
set dotenv-override := true
4-
5-
# some environment variables that are needed for _local_ commands
6-
# these are defaults that can be overwritten in your local .env file
7-
export DOCSRS_INCLUDE_DEFAULT_TARGETS := env("DOCSRS_INCLUDE_DEFAULT_TARGETS", "false")
8-
export DOCSRS_LOG := env("DOCSRS_LOG", "docs_rs=debug,rustwide=info")
9-
export RUST_BACKTRACE := env("RUST_BACKTRACE", "1")
10-
export DOCSRS_PREFIX := env("DOCSRS_PREFIX", "ignored/cratesfyi-prefix")
11-
12-
# database & s3 settings for local testing, to connect to the DB & S3/minio instance
13-
# configured in docker-compose.yml
14-
export DOCSRS_DATABASE_URL := env("DOCSRS_DATABASE_URL", "postgresql://cratesfyi:password@localhost:15432")
15-
export AWS_ACCESS_KEY_ID := env("AWS_ACCESS_KEY_ID", "cratesfyi")
16-
export AWS_SECRET_ACCESS_KEY := env("AWS_SECRET_ACCESS_KEY", "secret_key")
17-
export S3_ENDPOINT := env("S3_ENDPOINT", "http://localhost:9000")
18-
192

203
[group('testing')]
214
[group('sqlx')]

0 commit comments

Comments
 (0)