mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Basic Docker image for client app
This commit is contained in:
parent
f36a29570b
commit
9d46a1c73f
18
client/Dockerfile
Normal file
18
client/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
FROM node:20-alpine AS appbuild
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY package.json ./
|
||||
COPY package-lock.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build-release-linux
|
||||
|
||||
FROM node:20-alpine
|
||||
WORKDIR /usr/src/app
|
||||
COPY package.json ./
|
||||
COPY package-lock.json ./
|
||||
RUN npm install --omit=dev
|
||||
COPY . .
|
||||
COPY --from=appbuild /usr/src/app/public ./public
|
||||
EXPOSE 3000
|
||||
CMD npm start
|
||||
4
client/copy.sh
Executable file
4
client/copy.sh
Executable file
@ -0,0 +1,4 @@
|
||||
cp ./node_modules/leaflet/dist/leaflet.css ./public/stylesheets/leaflet/leaflet.css
|
||||
cp ./node_modules/leaflet-gesture-handling/dist/leaflet-gesture-handling.css ./public/stylesheets/leaflet/leaflet-gesture-handling.css
|
||||
cp ./node_modules/leaflet.nauticscale/dist/leaflet.nauticscale.js ./public/javascripts/leaflet.nauticscale.js
|
||||
cp ./node_modules/leaflet-path-drag/dist/L.Path.Drag.js ./public/javascripts/L.Path.Drag.js
|
||||
@ -7,6 +7,7 @@
|
||||
"scripts": {
|
||||
"build": "browserify .\\src\\index.ts --debug -o .\\public\\javascripts\\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ] && copy.bat",
|
||||
"build-release": "browserify .\\src\\index.ts -o .\\public\\javascripts\\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ] && copy.bat",
|
||||
"build-release-linux": "browserify ./src/index.ts -o ./public/javascripts/bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ] && ./copy.sh",
|
||||
"emit-declarations": "tsc --project tsconfig.json --declaration --emitDeclarationOnly --outfile ./@types/olympus/index.d.ts",
|
||||
"copy": "copy.bat",
|
||||
"start": "node ./bin/www",
|
||||
|
||||
9
docker-compose.yml
Normal file
9
docker-compose.yml
Normal file
@ -0,0 +1,9 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
client:
|
||||
build: client
|
||||
ports:
|
||||
- 3000:3000
|
||||
volumes:
|
||||
- ./olympus.json:/usr/src/olympus.json
|
||||
Loading…
x
Reference in New Issue
Block a user