stash
This commit is contained in:
parent
95ddb484eb
commit
8622e488a4
16 changed files with 607 additions and 369 deletions
|
|
@ -7,7 +7,7 @@ ENV PYTHONUNBUFFERED 1
|
|||
|
||||
# Set work directory
|
||||
WORKDIR /code
|
||||
|
||||
RUN mkdir /git
|
||||
# Install dependencies
|
||||
COPY requirements.txt /code/
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ FROM node:14
|
|||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
RUN mkdir /git
|
||||
|
||||
# Install app dependencies
|
||||
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ services:
|
|||
TOOLSHED_SETUP_PATH: /mnt/testdata.py
|
||||
volumes:
|
||||
- ../../backend:/code
|
||||
- ../../.git:/git:ro
|
||||
- ./instance_a/a.env:/code/.env
|
||||
- ./instance_a/testdata.py:/mnt/testdata.py
|
||||
- ./instance_a/a.sqlite3:/mnt/db.sqlite3
|
||||
|
|
@ -30,6 +31,7 @@ services:
|
|||
TOOLSHED_SETUP_PATH: /mnt/testdata.py
|
||||
volumes:
|
||||
- ../../backend:/code
|
||||
- ../../.git:/git:ro
|
||||
- ./instance_b/b.env:/code/.env
|
||||
- ./instance_b/testdata.py:/mnt/testdata.py
|
||||
- ./instance_b/b.sqlite3:/mnt/db.sqlite3
|
||||
|
|
@ -44,6 +46,7 @@ services:
|
|||
dockerfile: ../deploy/dev/Dockerfile.frontend
|
||||
volumes:
|
||||
- ../../frontend:/app
|
||||
- ../../.git:/git:ro
|
||||
- /app/node_modules
|
||||
expose:
|
||||
- 5173
|
||||
|
|
|
|||
|
|
@ -5,9 +5,15 @@
|
|||
|
||||
FROM python:3.11-slim
|
||||
|
||||
# The build context here is just backend/ (no .git), so settings.py's own
|
||||
# `git rev-parse` fallback can't find a repo - the actual commit is passed
|
||||
# in from the real checkout via this build-arg instead (see playbook.yml).
|
||||
ARG GIT_COMMIT=unknown
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
DJANGO_SETTINGS_MODULE=backend.settings
|
||||
DJANGO_SETTINGS_MODULE=backend.settings \
|
||||
GIT_COMMIT=$GIT_COMMIT
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,14 @@
|
|||
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
|
||||
# The build context here is just frontend/ (no .git), so vite.config.js's
|
||||
# own `git rev-parse` fallback can't find a repo - the actual commit is
|
||||
# passed in from the real checkout via this build-arg instead (see
|
||||
# playbook.yml).
|
||||
ARG GIT_COMMIT=unknown
|
||||
ENV GIT_COMMIT=$GIT_COMMIT
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
COPY extras/ ./extras/
|
||||
RUN npm ci
|
||||
|
|
|
|||
|
|
@ -294,6 +294,7 @@
|
|||
# pinned commit isn't fetchable from upstream - don't let a broken
|
||||
# submodule block the checkout.
|
||||
recursive: false
|
||||
register: toolshed_checkout
|
||||
|
||||
- name: Create toolshed system user
|
||||
ansible.builtin.user:
|
||||
|
|
@ -375,6 +376,7 @@
|
|||
ansible.builtin.command:
|
||||
cmd: >-
|
||||
docker build -t {{ toolshed_backend_image }}:{{ toolshed_image_tag }}
|
||||
--build-arg GIT_COMMIT={{ toolshed_checkout.after[:7] }}
|
||||
-f {{ toolshed_src_dir }}/deploy/prod/Dockerfile.backend {{ toolshed_src_dir }}/backend
|
||||
changed_when: true
|
||||
notify: restart backend
|
||||
|
|
@ -462,6 +464,7 @@
|
|||
version: "{{ toolshed_version | default('stable') }}"
|
||||
force: true
|
||||
recursive: false
|
||||
register: toolshed_frontend_checkout
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
|
|
@ -469,6 +472,7 @@
|
|||
ansible.builtin.command:
|
||||
cmd: >-
|
||||
docker build -t {{ toolshed_frontend_image }}:{{ toolshed_image_tag }}
|
||||
--build-arg GIT_COMMIT={{ toolshed_frontend_checkout.after[:7] }}
|
||||
-f {{ toolshed_frontend_build_src_dir }}/deploy/prod/Dockerfile.frontend {{ toolshed_frontend_build_src_dir }}/frontend
|
||||
changed_when: true
|
||||
delegate_to: localhost
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue