-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df57f67
commit d2e814f
Showing
11 changed files
with
101 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.env.local | ||
.env | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
FROM node:20-alpine | ||
# Build Stage | ||
FROM node:20-alpine AS builder | ||
|
||
WORKDIR /knock-bank-web | ||
WORKDIR /knockbank_web | ||
|
||
COPY package.json package-lock.json /knock-bank-web/ | ||
COPY package.json package-lock.json ./ | ||
|
||
RUN apk update && \ | ||
npm install | ||
RUN npm install | ||
|
||
COPY . /knock-bank-web/ | ||
COPY src ./src | ||
COPY public ./public | ||
COPY next.config.mjs tailwind.config.ts postcss.config.mjs tsconfig.json ./ | ||
|
||
ARG NEXT_PUBLIC_API_URL | ||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL | ||
|
||
RUN npm run build | ||
|
||
# Runtime Stage | ||
FROM node:20-alpine as runtime | ||
|
||
WORKDIR /knockbank_web | ||
|
||
COPY --from=builder /knockbank_web/.next ./.next | ||
COPY --from=builder /knockbank_web/public ./public | ||
COPY --from=builder /knockbank_web/node_modules ./node_modules | ||
COPY --from=builder /knockbank_web/package.json ./ | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["npm", "run", "start"] | ||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.venv | ||
__pycache__ | ||
Dockerfile | ||
users.txt | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,38 @@ | ||
FROM python:3.11-alpine | ||
# Build Stage | ||
FROM python:3.11-alpine as builder | ||
|
||
WORKDIR /knock-bank-api | ||
RUN apk update && \ | ||
pip install --upgrade pip && \ | ||
pip install --no-cache-dir poetry | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
WORKDIR /knockbank_api | ||
|
||
COPY pyproject.toml poetry.lock /knockbank_api/ | ||
|
||
COPY pyproject.toml poetry.lock /knock-bank-api/ | ||
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root | ||
|
||
# Runtime Stage | ||
FROM python:3.11-alpine as runtime | ||
|
||
ENV VIRTUAL_ENV=/knockbank_api/.venv \ | ||
PATH="/knockbank_api/.venv/bin:$PATH" | ||
|
||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
|
||
RUN apk update && \ | ||
pip install --upgrade pip && \ | ||
pip install --no-cache-dir poetry && \ | ||
poetry config virtualenvs.create false && \ | ||
poetry install && \ | ||
poetry add gunicorn | ||
pip install gunicorn | ||
|
||
WORKDIR /knockbank_api | ||
|
||
COPY . /knock-bank-api/ | ||
COPY pyproject.toml /knockbank_api | ||
COPY knockbankapi /knockbank_api/knockbankapi/ | ||
COPY migrations /knockbank_api/migrations/ | ||
|
||
EXPOSE 5000 | ||
|
||
CMD ["gunicorn", "-b", "0.0.0.0:5000", "knockbankapi:create_app()"] | ||
CMD flask --app knockbankapi db upgrade ; gunicorn -b 0.0.0.0:5000 'knockbankapi:create_app()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters