diff --git a/Dockerfile b/Dockerfile index da4239a..310cbe3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,19 +26,9 @@ WORKDIR /app # Copy the compiled executable from builder COPY --from=builder /app/bin/server.exe ./bin/server.exe -# Copy the built Flutter web app +#Copy the built Flutter web app COPY web/ ./web/ -# Set environment variables -ENV PORT=9090 -ENV POSTGRES_HOST=localhost -ENV POSTGRES_PORT=5432 -ENV POSTGRES_DB=family_safety -ENV POSTGRES_USER=postgres -ENV POSTGRES_PASSWORD=postgres -ENV JWT_SECRET=your-super-secret-key-change-me -ENV TOKEN_LIFETIME=600 - EXPOSE 9090 CMD ["./bin/server.exe"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..14e7249 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,20 @@ +pipeline { + agent any + + options { + buildDiscarder(logRotator(numToKeepStr: '10')) + disableConcurrentBuilds() + timeout(time: 1, unit: 'MINUTES') + timestamps() + } + + stages { + stage('Docker build') { + steps { + echo 'Docker build' + sh "docker build --no-cache -t geotracker ." + } + } + } + +} diff --git a/bin/routes/auth_routes.dart b/bin/routes/auth_routes.dart index 75bc217..55ec773 100644 --- a/bin/routes/auth_routes.dart +++ b/bin/routes/auth_routes.dart @@ -60,6 +60,7 @@ class AuthRoutes { Future _register(Request request) async { final stopwatch = Stopwatch()..start(); final body = await request.readAsString(); + logRequest(method: 'POST', url: '/reg', status: 444, duration: stopwatch.elapsed, body: body); final data = jsonDecode(body); final login = data['login']; diff --git a/docker-compose.yml b/docker-compose.yml index ffd4ef0..4ad7ea3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,17 +7,35 @@ services: restart: unless-stopped volumes: - postgres_data:/var/lib/postgresql/data + - ./data:/var/lib/postgresql/data app: - build: . + image: geotracker container_name: family_safety_app restart: unless-stopped ports: - - "9090:9090" + - "127.0.0.1:9090:9090" depends_on: - db: - condition: service_healthy + - db volumes: postgres_data: + + +#services: +# db: +# image: postgres:16-alpine +# container_name: family_safety_db +# restart: unless-stopped +# volumes: +# - ./data:/var/lib/postgresql/data +# +# app: +# image: geotracker +# container_name: family_safety_app +# restart: unless-stopped +# ports: +# - "127.0.0.1:9090:9090" +# depends_on: +# - db \ No newline at end of file