Build web via node docker
This commit is contained in:
+1
-17
@@ -1,29 +1,13 @@
|
||||
# Use a base image with Java and Scala, including SBT
|
||||
FROM hseeberger/scala-sbt:17.0.2_1.6.2_2.13.8 as build
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy project files to the Docker image
|
||||
COPY . /app
|
||||
|
||||
# Compile the application
|
||||
RUN sbt clean assembly
|
||||
|
||||
# Use a smaller base image for the final image
|
||||
FROM amazoncorretto:17-alpine
|
||||
|
||||
# Copy the compiled JAR from the build stage
|
||||
COPY --from=build /app/web/dist/ /web/dist/
|
||||
COPY --from=build /app/target/scala-2.13/WeatherTool-assembly-0.1.1-SNAPSHOT.jar /app.jar
|
||||
|
||||
# Define the volume to persist data
|
||||
VOLUME /data
|
||||
|
||||
# Command to run the application
|
||||
CMD ["java", "-jar", "/app.jar"]
|
||||
|
||||
|
||||
|
||||
|
||||
# docker build -t scala-app .
|
||||
# docker run -v /local/data/path:/data scala-app
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
Tool for downloading historical and real-time data from 33 weather stations in Latvia. It aggregates and displays data for different time periods, cities, and weather parameters.
|
||||
|
||||
## Run
|
||||
```
|
||||
docker-compose up node
|
||||
docker-compose up scala
|
||||
```
|
||||
|
||||
## Run
|
||||
```
|
||||
// scala
|
||||
|
||||
+9
-2
@@ -1,7 +1,14 @@
|
||||
version: '3'
|
||||
services:
|
||||
node:
|
||||
image: node:16.13.1
|
||||
working_dir: /app/web
|
||||
volumes:
|
||||
- $PWD/web:/app/web
|
||||
command: sh -c "npm install && npm run build"
|
||||
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
image: postgres:16.1
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
@@ -11,7 +18,7 @@ services:
|
||||
volumes:
|
||||
- /var/lib/postgresql/data:/var/lib/postgresql/data
|
||||
|
||||
scala-app:
|
||||
scala:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.local
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
## Usage
|
||||
|
||||
Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.
|
||||
|
||||
This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template.
|
||||
|
||||
```bash
|
||||
$ npm install # or pnpm install or yarn install
|
||||
```
|
||||
|
||||
### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
|
||||
|
||||
## Available Scripts
|
||||
|
||||
In the project directory, you can run:
|
||||
|
||||
### `npm dev` or `npm start`
|
||||
|
||||
Runs the app in the development mode.<br>
|
||||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
||||
|
||||
The page will reload if you make edits.<br>
|
||||
|
||||
### `npm run build`
|
||||
|
||||
Builds the app for production to the `dist` folder.<br>
|
||||
It correctly bundles Solid in production mode and optimizes the build for the best performance.
|
||||
|
||||
The build is minified and the filenames include the hashes.<br>
|
||||
Your app is ready to be deployed!
|
||||
|
||||
## Deployment
|
||||
|
||||
You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.)
|
||||
Reference in New Issue
Block a user