Fix docker compose setup and add redaktions app

This commit is contained in:
Christoph Lienhard 2020-01-31 23:01:08 +01:00
parent ea4cbfee3f
commit 74e282a92b
9 changed files with 6175 additions and 2964 deletions

6
backend/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM postgres:11.5
COPY ./sql/* /docker-entrypoint-initdb.d/
RUN localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8
ENV LANG de_DE.utf8

View File

@ -1,10 +1,23 @@
version: '3.1'
services:
redaktion:
container_name: redaktion
build:
context: ./redaktions-app/
dockerfile: ./dev.Dockerfile
volumes:
- './redaktions-app:/app'
- '/redaktions-app/node_modules'
ports:
- '3001:3000'
environment:
- NODE_ENV=development
postgres:
image: candymat-postgres:11.5
build:
dockerfile: ./Dockerfile.postgres
dockerfile: ./Dockerfile
context: ./backend/
env_file: ./backend/.env-backend
ports:
@ -21,7 +34,7 @@ services:
env_file: ./backend/.env-backend
ports:
- "5000:5000"
command: ["postgraphile", "--connection", $DATABASE_URL, "--host", "0.0.0.0", "--port", "5000", "--schema", "candymat_data", "--watch"]
command: ["--connection", $DATABASE_URL, "--host", "0.0.0.0", "--port", "5000", "--schema", "candymat_data", "--watch"]
networks:
- frontend
- backend

View File

@ -1,10 +1,18 @@
version: '3.1'
services:
redaktion:
container_name: redaktions-app
build:
context: ./redaktions-app/
dockerfile: ./prod.Dockerfile
ports:
- '80:80'
postgres:
image: candymat-postgres:11.5
build:
dockerfile: ./Dockerfile.postgres
dockerfile: ./Dockerfile
context: ./backend/
env_file: ./backend/.env-backend
volumes:
@ -23,7 +31,7 @@ services:
env_file: ./backend/.env-backend
ports:
- "5000:5000"
command: ["postgraphile", "--connection", $DATABASE_URL, "--host", "0.0.0.0", "--port", "5000", "--schema", "candymat_data", "--watch"]
command: ["--connection", $DATABASE_URL, "--host", "0.0.0.0", "--port", "5000", "--schema", "candymat_data", "--watch"]
networks:
- frontend
- backend

View File

@ -0,0 +1 @@
node_modules

View File

@ -0,0 +1,14 @@
FROM node:12.2.0-alpine
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json /app/package.json
COPY src /app/src
COPY public /app/public
RUN npm install
RUN npm install react-scripts@3.0.1 -g
CMD ["npm", "start"]

File diff suppressed because it is too large Load Diff

View File

@ -3,17 +3,16 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"typescript": "^3.6.2",
"@material-ui/core": "^4.4.0",
"@material-ui/icons": "^4.2.1",
"@types/jest": "24.0.18",
"@types/node": "12.7.3",
"@types/react": "16.9.2",
"@types/react-dom": "16.9.0",
"eslint": "^6.3.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1",
"typescript": "3.6.2"
"react-scripts": "^3.3.1"
},
"scripts": {
"start": "react-scripts start",

View File

@ -0,0 +1,13 @@
FROM node:12.2.0-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json /app/package.json
RUN npm install
RUN npm install react-scripts@3.0.1 -g
COPY . /app
RUN npm run build
FROM nginx:1.16.0-alpine
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@ -6,7 +6,7 @@
"es6",
"dom"
],
"jsx": "react",
"jsx": "preserve",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"strict": true,