mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 08:16:28 +00:00
improve docker build and wait for memcached
This commit is contained in:
parent
1d55d7f2d2
commit
9029f72a02
@ -1,2 +1,15 @@
|
||||
/**/target
|
||||
/**/node_modules
|
||||
*
|
||||
!/entry.sh
|
||||
|
||||
!/backend/src
|
||||
!/backend/Cargo.lock
|
||||
!/backend/Cargo.toml
|
||||
|
||||
!/frontend/locales
|
||||
!/frontend/src
|
||||
!/frontend/static
|
||||
!/frontend/.npmrc
|
||||
!/frontend/package.json
|
||||
!/frontend/pnpm-lock.yaml
|
||||
!/frontend/svelte.config.js
|
||||
!/frontend/tsconfig.json
|
||||
|
27
Dockerfile
27
Dockerfile
@ -1,31 +1,26 @@
|
||||
# Frontend
|
||||
FROM node:16-alpine as CLIENT
|
||||
|
||||
# FRONTEND
|
||||
FROM node:16-alpine as client
|
||||
WORKDIR /tmp
|
||||
COPY ./frontend ./
|
||||
|
||||
RUN npm install -g pnpm
|
||||
COPY ./frontend ./
|
||||
RUN pnpm install
|
||||
RUN pnpm run build
|
||||
|
||||
# Backend
|
||||
FROM rust:1.59-alpine as RUST
|
||||
|
||||
# BACKEND
|
||||
FROM rust:1.61-alpine as backend
|
||||
WORKDIR /tmp
|
||||
RUN apk add libc-dev openssl-dev alpine-sdk
|
||||
COPY ./backend ./
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
# Server
|
||||
|
||||
# RUNNER
|
||||
FROM alpine
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=RUST /tmp/target/release/cryptgeon .
|
||||
COPY --from=CLIENT /tmp/build ./frontend/build
|
||||
|
||||
COPY ./entry.sh .
|
||||
COPY --from=backend /tmp/target/release/cryptgeon .
|
||||
COPY --from=client /tmp/build ./frontend/build
|
||||
ENV MEMCACHE=memcached:11211
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
ENTRYPOINT [ "/app/cryptgeon" ]
|
||||
ENTRYPOINT [ "/app/entry.sh" ]
|
||||
|
Loading…
Reference in New Issue
Block a user