Skip to content

Commit ebef5fc

Browse files
committed
chore: backport auth2 docker stuff
1 parent 1fb2ed2 commit ebef5fc

File tree

2 files changed

+33
-38
lines changed

2 files changed

+33
-38
lines changed

Dockerfile

+24-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
FROM rust:1-alpine3.19 as chef
2-
ENV RUSTFLAGS="-C target-feature=-crt-static"
3-
RUN apk update
4-
RUN apk add --no-cache pkgconfig openssl openssl-dev musl-dev
5-
RUN cargo install cargo-chef
6-
WORKDIR /app
1+
FROM ubuntu:22.04
2+
3+
RUN apt-get -qq update
4+
5+
RUN apt-get install -y -q \
6+
git curl ca-certificates build-essential \
7+
libssl-dev pkg-config software-properties-common
8+
9+
# install rustup and add to path
10+
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
11+
ENV PATH="/root/.cargo/bin:${PATH}"
12+
13+
RUN cargo install sqlx-cli
14+
RUN cargo install cargo-watch
15+
RUN rustup component add clippy
16+
RUN rustup component add rust-analyzer
17+
18+
# install neovim and other dev stuff
19+
RUN apt-add-repository ppa:neovim-ppa/unstable
20+
RUN apt-get update
21+
RUN apt-get install -y -q neovim fzf \
22+
postgresql-client ripgrep
723

8-
FROM chef as planner
9-
COPY . .
10-
RUN cargo chef prepare --recipe-path recipe.json
24+
ENV TERM xterm-256color
1125

12-
FROM chef as builder
13-
COPY --from=planner /app/recipe.json recipe.json
14-
RUN cargo chef cook --release --recipe-path recipe.json
15-
COPY . .
16-
RUN cargo build --release
17-
RUN strip target/release/geode-index
26+
RUN git config --global --add safe.directory /app
1827

19-
FROM alpine:3.19
2028
WORKDIR /app
21-
COPY --from=builder /app/target/release/geode-index /app/target/release/geode-index
22-
COPY . .
23-
RUN apk add --no-cache libgcc
24-
RUN chmod +x /app/target/release/geode-index
25-
EXPOSE 3000
26-
ENTRYPOINT [ "/app/target/release/geode-index" ]
+9-16
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
1-
version: "3.8"
21
name: "geode-index"
32
services:
43
app:
54
build:
65
context: ./
7-
dockerfile: Dockerfile-dev
6+
dockerfile: Dockerfile
87
container_name: geode-index
98
restart: unless-stopped
10-
environment:
11-
- DATABASE_URL=postgres://geode:geode@geode-postgres/geode
12-
develop:
13-
watch:
14-
- action: rebuild
15-
path: ./src
16-
target: /app
17-
ignore:
18-
- "target"
9+
stdin_open: true
10+
tty: true
1911
depends_on:
2012
- postgres
21-
env_file:
22-
- ./.env
2313
networks:
2414
- dev
2515
ports:
26-
- "3000:3000"
16+
- "${PORT:-3000}:${PORT:-3000}"
17+
volumes:
18+
- ./:/app
19+
- "${HOME}/.config/nvim:/root/.config/nvim"
2720
postgres:
2821
container_name: geode-postgres
29-
image: postgres:14.10-alpine3.19
22+
image: postgres:14-alpine3.20
3023
restart: unless-stopped
3124
environment:
3225
- POSTGRES_PASSWORD=geode
@@ -42,4 +35,4 @@ volumes:
4235
postgres-db:
4336
networks:
4437
dev:
45-
driver: bridge
38+
driver: bridge

0 commit comments

Comments
 (0)