Temporarily configure docker-compose for dev/debug

This commit is contained in:
D. Scott Boggs 2023-06-14 10:21:52 -04:00
parent 526990704b
commit 76cb73bb03
4 changed files with 30 additions and 7 deletions

View file

@ -4,12 +4,9 @@ all: start-server
client/dist/index.html:
cd client; yarn && yarn build
build-client: client/dist/index.html
build-client: client/dist/index.html
server/public/: client/dist/index.html
rsync -a client/dist/ server/public/
start-server: server/public/
start-server: build-client
docker compose up --build -d
clean:

View file

@ -2,7 +2,10 @@ version: "3.5"
services:
server:
build: ./server
# build: ./server
build:
context: ./server
dockerfile: Dockerfile.debug
networks:
- web
- internal
@ -16,6 +19,8 @@ services:
ports:
# TODO remove in prod
- 8000:8000
volumes:
- ./client/dist:/src/public:ro
database:
image: postgres
environment:

View file

@ -1,4 +1,8 @@
FROM rustlang/rust:nightly-bullseye-slim
RUN apt-get update &&\
apt-get install sqlite3 &&\
apt-get clean &&\
rm -rf /var/lib/apt/lists
WORKDIR /src
ADD Cargo.toml Cargo.lock /src/
RUN echo "fn main() {}" > dummy.rs &&\
@ -8,5 +12,5 @@ ADD src/ src/
RUN rm dummy.rs &&\
sed -i "s:dummy.rs:src/main.rs:" Cargo.toml
RUN cargo build --release
ADD public/ public/
# ADD public/ public/
CMD ["target/release/kalkulog-server"]

17
server/Dockerfile.debug Normal file
View file

@ -0,0 +1,17 @@
FROM rustlang/rust:nightly-bullseye-slim
RUN apt-get update &&\
apt-get install -yq sqlite3 &&\
apt-get clean &&\
rm -rf /var/lib/apt/lists
WORKDIR /src
ADD Cargo.toml Cargo.lock /src/
RUN echo "fn main() {}" > dummy.rs &&\
sed -i "s:src/main.rs:dummy.rs:" Cargo.toml
RUN cargo build --release
ADD src/ src/
RUN rm dummy.rs &&\
sed -i "s:dummy.rs:src/main.rs:" Cargo.toml
RUN cargo build --release
# ADD public/ public/
CMD ["target/release/kalkulog-server"]