Compare commits
No commits in common. "1379a436b39fef01596b36a18d760e6a12d8dc8e" and "1179fa0f80c4a430c5ae1ca91aa07462fb5508c1" have entirely different histories.
1379a436b3
...
1179fa0f80
3 changed files with 60 additions and 64 deletions
47
Dockerfile
47
Dockerfile
|
|
@ -1,7 +1,6 @@
|
|||
ARG NODE_VERSION=24
|
||||
ARG PYTHON_VERSION=3.14
|
||||
|
||||
|
||||
############
|
||||
# build ui #
|
||||
############
|
||||
|
|
@ -9,25 +8,25 @@ ARG PYTHON_VERSION=3.14
|
|||
ARG NODE_VERSION
|
||||
FROM node:${NODE_VERSION} AS build-ui
|
||||
|
||||
# install ui dependencies
|
||||
# env setup
|
||||
WORKDIR /usr/local/src/advent22_ui
|
||||
|
||||
# install advent22_ui dependencies
|
||||
RUN --mount=type=bind,source=ui/package.json,target=package.json \
|
||||
--mount=type=bind,source=ui/yarn.lock,target=yarn.lock \
|
||||
--mount=type=bind,source=ui/.yarn/releases,target=.yarn/releases \
|
||||
--mount=type=bind,source=ui/.yarnrc.yml,target=.yarnrc.yml \
|
||||
--mount=type=cache,id=ui,target=/root/.yarn \
|
||||
\
|
||||
yarn install --immutable --check-cache;
|
||||
|
||||
# copy and build ui
|
||||
COPY ui ./
|
||||
RUN --mount=type=cache,id=ui,target=/root/.yarn \
|
||||
set -ex; \
|
||||
\
|
||||
corepack enable; \
|
||||
yarn install --frozen-lockfile;
|
||||
|
||||
# copy and build advent22_ui
|
||||
COPY ui ./
|
||||
RUN set -ex; \
|
||||
\
|
||||
yarn dlx update-browserslist-db@latest; \
|
||||
yarn build --dest /opt/advent22/ui; \
|
||||
yarn build --dest /tmp/advent22_ui; \
|
||||
# exclude webpack-bundle-analyzer output
|
||||
rm -f /opt/advent22/ui/report.html;
|
||||
rm -f /tmp/advent22_ui/report.html;
|
||||
|
||||
|
||||
###############
|
||||
|
|
@ -36,17 +35,18 @@ RUN --mount=type=cache,id=ui,target=/root/.yarn \
|
|||
|
||||
ARG PYTHON_VERSION
|
||||
FROM dhi.io/python:${PYTHON_VERSION}-dev AS install-app
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
|
||||
# env setup
|
||||
WORKDIR /opt/advent22
|
||||
ENV UV_COMPILE_BYTECODE=1 \
|
||||
ENV UV_WORKING_DIR="api/" \
|
||||
UV_COMPILE_BYTECODE=1 \
|
||||
UV_NO_DEV=1 \
|
||||
UV_LINK_MODE="copy"
|
||||
|
||||
RUN --mount=type=bind,source=api/uv.lock,target=api/uv.lock \
|
||||
RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
|
||||
--mount=type=cache,target=/root/.cache/uv \
|
||||
--mount=type=bind,source=api/uv.lock,target=api/uv.lock \
|
||||
--mount=type=bind,source=api/pyproject.toml,target=api/pyproject.toml \
|
||||
--mount=type=cache,id=api,target=/root/.cache/uv \
|
||||
set -ex; \
|
||||
\
|
||||
# prepare data directory
|
||||
|
|
@ -54,26 +54,25 @@ RUN --mount=type=bind,source=api/uv.lock,target=api/uv.lock \
|
|||
chown nobody:nobody data; \
|
||||
chmod u=rwx,g=rx,o=rx data; \
|
||||
\
|
||||
# install api deps
|
||||
# install advent22_api deps
|
||||
uv sync \
|
||||
--project api/ \
|
||||
--locked \
|
||||
--no-install-project \
|
||||
--no-editable \
|
||||
;
|
||||
|
||||
# install api
|
||||
# install advent22_api
|
||||
COPY api api/
|
||||
RUN --mount=type=cache,id=api,target=/root/.cache/uv \
|
||||
RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
|
||||
--mount=type=cache,target=/root/.cache/uv \
|
||||
\
|
||||
uv sync \
|
||||
--project api/ \
|
||||
--locked \
|
||||
--no-editable \
|
||||
;
|
||||
|
||||
# add prepared ui
|
||||
COPY --from=build-ui /opt/advent22/ui ui/
|
||||
# add prepared advent22_ui
|
||||
COPY --from=build-ui /tmp/advent22_ui ui/
|
||||
|
||||
|
||||
####################
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
||||
"ghcr.io/devcontainers-extra/features/uv:1": {},
|
||||
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
|
||||
"plugins": "git-flow uv"
|
||||
"plugins": "uv"
|
||||
},
|
||||
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
|
||||
"packages": "git-flow"
|
||||
|
|
|
|||
|
|
@ -1,51 +1,48 @@
|
|||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/javascript-node
|
||||
{
|
||||
"name": "Advent22 UI",
|
||||
"name": "Advent22 UI",
|
||||
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-trixie",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-trixie",
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
||||
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
|
||||
"plugins": "git-flow npm nvm yarn"
|
||||
},
|
||||
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
|
||||
"packages": "git-flow"
|
||||
},
|
||||
"ghcr.io/devcontainers-extra/features/vue-cli:2": {}
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
||||
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
|
||||
"packages": "git-flow"
|
||||
},
|
||||
"ghcr.io/devcontainers-extra/features/vue-cli:2": {}
|
||||
},
|
||||
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
// Configure properties specific to VS Code.
|
||||
"vscode": {
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.defaultProfile.linux": "zsh"
|
||||
},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"mhutchie.git-graph",
|
||||
"Syler.sass-indented",
|
||||
"Vue.volar"
|
||||
]
|
||||
}
|
||||
},
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
// Configure properties specific to VS Code.
|
||||
"vscode": {
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.defaultProfile.linux": "zsh"
|
||||
},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"mhutchie.git-graph",
|
||||
"Syler.sass-indented",
|
||||
"Vue.volar"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "yarn install",
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "yarn install",
|
||||
|
||||
// Use 'postStartCommand' to run commands after the container is started.
|
||||
"postStartCommand": "yarn dlx update-browserslist-db@latest && yarn install"
|
||||
// Use 'postStartCommand' to run commands after the container is started.
|
||||
"postStartCommand": "yarn dlx update-browserslist-db@latest && yarn install"
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue