Compare commits
13 Commits
repo-clean
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
|
f1de898b61 | ||
|
c7bbd0119f | ||
|
1f24d456e0 | ||
|
c4e9cd0f1d | ||
|
2981665f1f | ||
|
d9f0c9ac45 | ||
|
eee88b403c | ||
|
25f962b5e1 | ||
|
0d954877e5 | ||
|
3a9b88700e | ||
|
d7a15dd12a | ||
|
d3334672ce | ||
|
302bbda11a |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -6,7 +6,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: docker/build-push-action@v1
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
push: false
|
push: false
|
||||||
|
10
Dockerfile
10
Dockerfile
@@ -1,11 +1,11 @@
|
|||||||
# Install the base requirements for the app.
|
# Install the base requirements for the app.
|
||||||
# This stage is to support development.
|
# This stage is to support development.
|
||||||
FROM python:alpine AS base
|
FROM --platform=$BUILDPLATFORM python:alpine AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
FROM node:18-alpine AS app-base
|
FROM --platform=$BUILDPLATFORM node:18-alpine AS app-base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY app/package.json app/yarn.lock ./
|
COPY app/package.json app/yarn.lock ./
|
||||||
COPY app/spec ./spec
|
COPY app/spec ./spec
|
||||||
@@ -25,16 +25,16 @@ RUN apk add zip && \
|
|||||||
zip -r /app.zip /app
|
zip -r /app.zip /app
|
||||||
|
|
||||||
# Dev-ready container - actual files will be mounted in
|
# Dev-ready container - actual files will be mounted in
|
||||||
FROM base AS dev
|
FROM --platform=$BUILDPLATFORM base AS dev
|
||||||
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
|
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
|
||||||
|
|
||||||
# Do the actual build of the mkdocs site
|
# Do the actual build of the mkdocs site
|
||||||
FROM base AS build
|
FROM --platform=$BUILDPLATFORM base AS build
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN mkdocs build
|
RUN mkdocs build
|
||||||
|
|
||||||
# Extract the static content from the build
|
# Extract the static content from the build
|
||||||
# and use a nginx image to serve the content
|
# and use a nginx image to serve the content
|
||||||
FROM nginx:alpine
|
FROM --platform=$TARGETPLATFORM nginx:alpine
|
||||||
COPY --from=app-zip-creator /app.zip /usr/share/nginx/html/assets/app.zip
|
COPY --from=app-zip-creator /app.zip /usr/share/nginx/html/assets/app.zip
|
||||||
COPY --from=build /app/site /usr/share/nginx/html
|
COPY --from=build /app/site /usr/share/nginx/html
|
||||||
|
@@ -1560,9 +1560,9 @@ html-escaper@^2.0.0:
|
|||||||
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
|
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
|
||||||
|
|
||||||
http-cache-semantics@^4.1.0:
|
http-cache-semantics@^4.1.0:
|
||||||
version "4.1.0"
|
version "4.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
|
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a"
|
||||||
integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==
|
integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==
|
||||||
|
|
||||||
http-errors@2.0.0:
|
http-errors@2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
|
@@ -151,6 +151,8 @@ which ships with a _lot_ of tools that are useful for troubleshooting or debuggi
|
|||||||
What this means is... our app only simply needs to connect to a host named `mysql` and it'll talk to the
|
What this means is... our app only simply needs to connect to a host named `mysql` and it'll talk to the
|
||||||
database! It doesn't get much simpler than that!
|
database! It doesn't get much simpler than that!
|
||||||
|
|
||||||
|
When you're done, run `exit` to close out of the container.
|
||||||
|
|
||||||
|
|
||||||
## Running our App with MySQL
|
## Running our App with MySQL
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@ see a few flaws in the Dockerfile below. But, don't worry! We'll go over them.
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN yarn install --production
|
RUN yarn install --production
|
||||||
CMD ["node", "src/index.js"]
|
CMD ["node", "./src/index.js"]
|
||||||
```
|
```
|
||||||
|
|
||||||
Please check that the file `Dockerfile` has no file extension like `.txt`. Some editors may append this file extension automatically and this would result in an error in the next step.
|
Please check that the file `Dockerfile` has no file extension like `.txt`. Some editors may append this file extension automatically and this would result in an error in the next step.
|
||||||
|
@@ -34,7 +34,7 @@ To run our container to support a development workflow, we will do the following
|
|||||||
|
|
||||||
So, let's do it!
|
So, let's do it!
|
||||||
|
|
||||||
1. Make sure you don't have any previous `getting-started` containers running.
|
1. Make sure you don't have any of your own `getting-started` containers running (only the tutorial itself should be running).
|
||||||
|
|
||||||
1. Also make sure you are in app source code directory, i.e. `/path/to/getting-started/app`. If you aren't, you can `cd` into it, .e.g:
|
1. Also make sure you are in app source code directory, i.e. `/path/to/getting-started/app`. If you aren't, you can `cd` into it, .e.g:
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ another system, you can install Docker Compose using [the instructions here](htt
|
|||||||
|
|
||||||
## Creating our Compose File
|
## Creating our Compose File
|
||||||
|
|
||||||
1. At the root of the app project, create a file named `docker-compose.yml`.
|
1. Inside of the app folder, create a file named `docker-compose.yml` (next to the `Dockerfile` and `package.json` files).
|
||||||
|
|
||||||
1. In the compose file, we'll start off by defining a list of services (or containers) we want to run as part of our application.
|
1. In the compose file, we'll start off by defining a list of services (or containers) we want to run as part of our application.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user