add docker file
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
out
|
out
|
||||||
.env
|
.env
|
||||||
learn-cicd-starter
|
learn-cicd-starter
|
||||||
|
notely
|
||||||
|
|||||||
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM --platform=linux/amd64 debian:stretch-slim
|
||||||
|
|
||||||
|
ADD notely /usr/bin/notely
|
||||||
|
|
||||||
|
CMD ["notely"]
|
||||||
@@ -17,7 +17,7 @@ PORT="8000"
|
|||||||
Run the server:
|
Run the server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go build -o out && ./out
|
go build -o notely && ./notely
|
||||||
```
|
```
|
||||||
|
|
||||||
*This starts the server in non-database mode.* It will serve a webpage at `http://localhost:8000`. However, you won't be able to interact with the webpage until you connect it to a MySQL database and run the migrations.
|
*This starts the server in non-database mode.* It will serve a webpage at `http://localhost:8000`. However, you won't be able to interact with the webpage until you connect it to a MySQL database and run the migrations.
|
||||||
@@ -47,7 +47,7 @@ Then run the migrations:
|
|||||||
Start the server:
|
Start the server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go build -o out && ./out
|
go build -o notely && ./notely
|
||||||
```
|
```
|
||||||
|
|
||||||
Because the `DATABASE_URL` environment variable is set, the server will connect to the database and serve the webpage at `http://localhost:8000`. The page should be fully functional now. You can:
|
Because the `DATABASE_URL` environment variable is set, the server will connect to the database and serve the webpage at `http://localhost:8000`. The page should be fully functional now. You can:
|
||||||
|
|||||||
Reference in New Issue
Block a user