Fix docker configs.

This commit is contained in:
JSH32 2022-09-21 23:39:51 -05:00
parent 6bd35b9d35
commit e228f11c01
5 changed files with 16 additions and 17 deletions

View File

@ -4,19 +4,23 @@ FROM rust:1.60 as build
RUN USER=root cargo new --bin backpack
WORKDIR /backpack
# copy over your manifests
COPY Cargo.toml Cargo.lock ./
# # copy over your manifests
# COPY Cargo.toml Cargo.lock ./
# COPY migration/Cargo.toml ./migration/Cargo.toml
# Cache dependencies
RUN cargo build --release
RUN rm src/*.rs
# # Cache dependencies
# RUN cargo build --release
# RUN rm src/*.rs
# Copy source
# # Copy source
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
COPY ./src ./src
COPY ./migration ./migration
COPY ./.git ./.git
# Build for release
RUN rm ./target/release/deps/backpack*
# RUN rm ./target/release/deps/backpack*
RUN cargo build --release
# Running stage
@ -25,7 +29,4 @@ FROM rust:1.60
# Copy the build artifact from the build stage
COPY --from=build /backpack/target/release/backpack .
# Migrations needed at runtime
COPY ./migrations ./migrations
CMD ["./backpack"]

View File

@ -24,4 +24,4 @@ services:
env_file: .env
depends_on:
- backpack_api
- backpack_client
- backpack_frontend

View File

@ -1,8 +1,8 @@
FROM node:lts-alpine AS deps
WORKDIR /frontend
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY package.json package-lock.json ./
RUN npm install
# Build source code
FROM node:lts-alpine AS builder
@ -11,7 +11,7 @@ ENV NODE_ENV=production
WORKDIR /frontend
COPY . .
COPY --from=deps /frontend/node_modules ./node_modules
RUN yarn build
RUN npm run build
# Production image, copy all the files and run next
FROM node:lts-alpine AS runner

View File

@ -5,9 +5,8 @@ import { VerificationMessage } from "./VerificationMessage"
import { useAppInfo } from "helpers/info"
import { UserData } from "@/client"
import api from "helpers/api"
import { Store, useStore } from "helpers/store"
import { useStore } from "helpers/store"
import { RegisterPrompt } from "./RegisterPrompt"
import { observer } from "mobx-react-lite"
import { observe } from "mobx"
export const Authenticated: React.FC<{

View File

@ -8,7 +8,6 @@ import axios from "axios"
import getConfig from "next/config"
import { AppInfo } from "@/client"
import api from "helpers/api"
import { Provider } from "mobx-react"
import { Store, StoreContext } from "helpers/store"
const { serverRuntimeConfig } = getConfig()