This commit is contained in:
Eugene Pankov 2021-07-25 20:45:15 +02:00
parent badc8302ce
commit 83c5e11a61
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
37 changed files with 37 additions and 5 deletions

4
.gitignore vendored
View File

@ -1,6 +1,4 @@
__pycache__
.vscode
.env
.mypy_cache
app-dist
db.sqlite3
.mypy_cache

Binary file not shown.

2
backend/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
__pycache__
db.sqlite3

17
backend/Dockerfile Normal file
View File

@ -0,0 +1,17 @@
# syntax=docker/dockerfile:1
FROM node:12-alpine AS build
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn
COPY webpack* tsconfig.json ./
COPY src src
RUN yarn run build
RUN yarn run build:server
FROM node:12-alpine AS package
WORKDIR /app
COPY --from=0 /app/build build
COPY --from=0 /app/build-server build-server
COPY package.json .
CMD ["npm", "start"]

12
backend/cloudbuild.yaml Normal file
View File

@ -0,0 +1,12 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
dir: 'backend'
args:
- build
- '-t'
- '${_DOCKER_PUBLISH_URL}'
- '--cache-from'
- '${_DOCKER_PUBLISH_URL}'
- '--build-arg'
- 'BACKEND_URL=${_BACKEND_URL}'
- '.'

View File

View File

@ -1,5 +1,6 @@
# syntax=docker/dockerfile:1
FROM node:12-alpine AS build
ARG BACKEND_URL
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn

View File

@ -4,9 +4,11 @@ steps:
args:
- build
- '-t'
- '${_DOCKER_PUBLISH_URL}'
- '${_DOCKER_TAG}'
- '--cache-from'
- '${_DOCKER_PUBLISH_URL}'
- '${_DOCKER_TAG}'
- '--build-arg'
- 'BACKEND_URL=${_BACKEND_URL}'
- '.'
images: ['${_DOCKER_TAG}']