Skip to content

Commit 2cb07fa

Browse files
author
Stephen Hinett
committed
update: got the frontend docker image up and running along with live/hot
reloading for changing files
1 parent 1300338 commit 2cb07fa

11 files changed

+5323
-130
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
# Go workspace file
1919
go.work
2020

21-
/tmp
21+
/backend/tmp
2222

2323
## Frontend list
24+
/frontend/dist
25+
2426
# Logs
2527
logs
2628
*.log

backend/docker-compose.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
services:
22
api:
3+
container_name: api
34
build:
4-
context: ./docker
5-
dockerfile: Dockerfile.dev
5+
context: ./
6+
dockerfile: docker/Dockerfile.dev
67
ports:
78
- "9000:9000"
89
volumes:
910
- ./:/api
10-
command: [ "air" ]
11+
command: air

frontend/.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/node_modules
2+
**/.parcel-cache

frontend/.eslintrc.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true
5+
},
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/eslint-recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
11+
'plugin:react/recommended',
12+
'plugin:react-hooks/recommended',
13+
'standard'
14+
],
15+
globals: {
16+
Atomics: 'readonly',
17+
SharedArrayBuffer: 'readonly'
18+
},
19+
parser: '@typescript-eslint/parser',
20+
parserOptions: {
21+
ecmaFeatures: {
22+
jsx: true
23+
},
24+
ecmaVersion: 2018,
25+
project: './tsconfig.json',
26+
sourceType: 'module'
27+
},
28+
plugins: [
29+
'react',
30+
'react-hooks',
31+
'@typescript-eslint'
32+
],
33+
settings: {
34+
react: { version: 'detect' }
35+
},
36+
rules: {
37+
}
38+
}

frontend/docker-compose.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
services:
22
frontend:
3+
container_name: client
34
build:
4-
context: ./docker
5-
dockerfile: Dockerfile.dev
5+
context: ./
6+
dockerfile: docker/Dockerfile.dev
67
ports:
7-
- "8080:80"
8+
- "8080:8080"
9+
- "33333:33333"
810
volumes:
9-
- ./:/frontend
11+
- ./:/client
12+
- /client/node_modules/
13+
- /client/.parcel-cache/
14+
command: [ "npm", "start" ]

frontend/docker/Dockerfile.dev

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
FROM node:16.15.0-alpine
22

33
# Working directory
4-
WORKDIR /frontend
4+
WORKDIR /client
55

6-
ENV PATH /frontend/node_modules/.bin:$PATH
6+
RUN apk update && apk add --no-cache nodejs npm python3 py3-pip build-base
77

8-
COPY package.json ./
9-
COPY package-lock.json ./
8+
COPY ./package.json ./package-lock.json ./
9+
RUN npm install --slient
1010

11-
RUN npm instal --slient
12-
13-
COPY . ./
14-
15-
CMD ["npm", "start"]
11+
COPY . .

0 commit comments

Comments
 (0)