Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SEP-2024-team-D
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nahodil, Petr
SEP-2024-team-D
Commits
fdd66cc2
Commit
fdd66cc2
authored
2 months ago
by
jenda
Browse files
Options
Downloads
Patches
Plain Diff
Add docker file
parent
fb935f4f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-1
1 addition, 1 deletion
.gitignore
Docker/docker-compose.yaml
+30
-0
30 additions, 0 deletions
Docker/docker-compose.yaml
FlightLogNet/Dockerfile
+55
-3
55 additions, 3 deletions
FlightLogNet/Dockerfile
readme.md
+78
-0
78 additions, 0 deletions
readme.md
with
164 additions
and
4 deletions
.gitignore
+
1
−
1
View file @
fdd66cc2
.direnv/
.idea/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
...
...
This diff is collapsed.
Click to expand it.
Docker/docker-compose.yaml
0 → 100644
+
30
−
0
View file @
fdd66cc2
version
:
'
3.8'
services
:
flightlognet
:
build
:
context
:
../FlightLogNet
dockerfile
:
Dockerfile
ports
:
-
"
5000:80"
# Upravit port
environment
:
-
DOTNET_RUNNING_IN_CONTAINER=true
-
ConnectionStrings__DefaultConnection=Host=postgresdb;Port=5432;Database=flightlog;Username=postgres;Password=secret
depends_on
:
-
postgresdb
restart
:
unless-stopped
postgresdb
:
image
:
postgres:15
container_name
:
postgresdb
environment
:
POSTGRES_USER
:
postgres
POSTGRES_PASSWORD
:
secret
POSTGRES_DB
:
flightlog
ports
:
-
"
5432:5432"
volumes
:
-
postgres_data:/var/lib/postgresql/data
volumes
:
postgres_data
:
This diff is collapsed.
Click to expand it.
FlightLogNet/Dockerfile
+
55
−
3
View file @
fdd66cc2
FROM
mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine
# syntax=docker/dockerfile:1
# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Dockerfile reference guide at
# https://docs.docker.com/go/dockerfile-reference/
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7
################################################################################
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
# Create a stage for building the application.
FROM
--platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine
AS
build
COPY
. /source
WORKDIR
/source
# This is the architecture you’re building for, which is passed in by the builder.
# Placing it here allows the previous steps to be cached across architectures.
ARG
TARGETARCH
# Build the application.
# Leverage a cache mount to /root/.nuget/packages so that subsequent builds don't have to re-download packages.
# If TARGETARCH is "amd64", replace it with "x64" - "x64" is .NET's canonical name for this and "amd64" doesn't
# work in .NET 6.0.
RUN
--mount
=
type
=
cache,id
=
nuget,target
=
/root/.nuget/packages
\
dotnet publish
-a
${
TARGETARCH
/amd64/x64
}
--use-current-runtime
--self-contained
false
-o
/app
# If you need to enable globalization and time zones:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md
################################################################################
# Create a new stage for running the application that contains the minimal
# runtime dependencies for the application. This often uses a different base
# image from the build stage where the necessary files are copied from the build
# stage.
#
# The example below uses an aspnet alpine image as the foundation for running the app.
# It will also use whatever happens to be the most recent version of that tag when you
# build your Dockerfile. If reproducibility is important, consider using a more specific
# version (e.g., aspnet:7.0.10-alpine-3.18),
# or SHA (e.g., mcr.microsoft.com/dotnet/aspnet@sha256:f3d99f54d504a21d38e4cc2f13ff47d67235efeeb85c109d3d1ff1808b38d034).
FROM
mcr.microsoft.com/dotnet/aspnet:8.0-alpine
AS
final
WORKDIR
/app
COPY
./bin/Release/net7.0/linux-musl-x64/publish ./
ENTRYPOINT
["./FlightLogNet"]
\ No newline at end of file
# Copy everything needed to run the app from the "build" stage.
COPY
--from=build /app .
# Switch to a non-privileged user (defined in the base image) that the app will run under.
# See https://docs.docker.com/go/dockerfile-user-best-practices/
# and https://github.com/dotnet/dotnet-docker/discussions/4764
USER
$APP_UID
ENTRYPOINT
["dotnet", "FlightLogNet.dll"]
This diff is collapsed.
Click to expand it.
readme.md
0 → 100644
+
78
−
0
View file @
fdd66cc2
## 🛠️ **Instalační příručka pro projekt FlightLogNet**
---
## 📋 **Předpoklady (Prerekvizity)**
Před nasazením aplikace je nutné zajistit následující:
1.
**Serverové požadavky**
-
Minimální hardwarové požadavky serveru jsou specifikovány ve specifikaci.
2.
**Přístup ke zdrojovému kódu**
-
TODO: Ujistěte se, že máte přístup k repozitáři projektu.
3.
**Nainstalované nástroje**
-
**Docker**
ve verzi uvedené ve specifikaci:
[
Oficiální návod na instalaci Docker Engine
](
https://docs.docker.com/get-docker/
)
.
-
**Docker Compose**
ve verzi uvedené ve specifikaci?:
[
Oficiální dokumentace Docker Compose
](
https://docs.docker.com/compose/install/
)
.
---
## 🚀 **Postup instalace**
### 1️⃣ **Stažení zdrojového kódu**
Otevřete terminál nebo příkazovou řádku a spusťte následující příkaz:
```
bash
git clone https://gitlab.fel.cvut.cz/nahodpe1/sep-2024-team-d
```
### 2️⃣ Spuštění Docker Engine
Ujistěte se, že máte spuštěný Docker Engine.
-
**Linux**
: Docker běží jako služba, ověřte pomocí:
```
bash
sudo
systemctl start docker
sudo
systemctl
enable
docker
```
-
**Windows/Mac**
: Spusťte Docker Desktop a ujistěte se, že běží.
### 3️⃣ Přepnutí do adresáře projektu
Přesuňte se do složky projektu:
```
bash
cd
sep-2024-team-d
```
### 4️⃣ Nasazení aplikace s Docker Compose
Spusťte následující příkaz pro sestavení a spuštění kontejnerů:
```
bash
docker compose up
--build
```
-
Docker Compose vytvoří všechny služby (včetně aplikace a databáze PostgreSQL).
-
Po dokončení bude aplikace dostupná na http://localhost:5000. TODO port a url?
### 🛠️ Řešení potíží
-
**Docker Compose nefunguje?**
- Zkontrolujte, že Docker a Docker Compose jsou správně nainstalované:
```bash
docker --version
docker-compose --version
```
-
**Problémy s připojením k databázi?**
- Ujistěte se, že služba postgresdb běží. Zkontrolujte logy:
```bash
docker-compose logs postgresdb
```
-
**Chyba při stahování repozitáře?**
- Ověřte svůj SSH klíč a přístupová práva v GitLabu.
### 📞 Technická podpora
-
V případě potíží se obraťte na technickou podporu společnosti SEPTIK PRO s.r.o.
- **Email**: support@septippro.cz
-
**Telefon**
: +420 000 000 000
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment