Compare commits
2 Commits
v0.6.5-mai
...
040288428d
| Author | SHA1 | Date | |
|---|---|---|---|
|
040288428d
|
|||
| cba3e3db79 |
@@ -36,7 +36,7 @@ jobs:
|
||||
# --- Add database service definition ---
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17.5
|
||||
image: postgres:18.0
|
||||
env:
|
||||
# Use secrets for DB init, with fallbacks for flexibility
|
||||
POSTGRES_USER: ${{ secrets.DB_TEST_USER || 'testuser' }}
|
||||
|
||||
@@ -64,7 +64,7 @@ COPY --from=builder /usr/src/app/.env .
|
||||
COPY --from=builder /usr/src/app/migrations ./migrations
|
||||
|
||||
# Expose the port your Axum app listens on (e.g., 3000 or 8000)
|
||||
EXPOSE 3000
|
||||
EXPOSE 8001
|
||||
|
||||
# Set the command to run your application
|
||||
# Ensure this matches the binary name copied above
|
||||
|
||||
@@ -2,6 +2,13 @@ A auth web API services for the Icarus project.
|
||||
|
||||
|
||||
# Getting Started
|
||||
Install the `sqlx` tool to use migrations.
|
||||
```
|
||||
cargo install sqlx-cli
|
||||
```
|
||||
This will be used to scaffold development for local environments.
|
||||
|
||||
|
||||
The easiest way to get started is through docker. This assumes that docker is already installed
|
||||
on your system. Copy the `.env.docker.sample` as `.env`. Most of the data in the env file doesn't
|
||||
need to be modified. The `SECRET_KEY` variable should be changed since it will be used for token
|
||||
@@ -33,4 +40,4 @@ docker system prune -a
|
||||
```
|
||||
|
||||
To view the OpenAPI spec, run the project and access `/swagger-ui`. If running through docker,
|
||||
the url would be something like `http://localhost:8000/swagger-ui`.
|
||||
the url would be something like `http://localhost:8001/swagger-ui`.
|
||||
|
||||
@@ -19,7 +19,7 @@ services:
|
||||
|
||||
# PostgreSQL Database Service
|
||||
auth_db:
|
||||
image: postgres:17.5-alpine # Use an official Postgres image (Alpine variant is smaller)
|
||||
image: postgres:18.0-alpine # Use an official Postgres image (Alpine variant is smaller)
|
||||
container_name: icarus_auth_db # Optional: Give the container a specific name
|
||||
environment:
|
||||
# These MUST match the user, password, and database name in the DATABASE_URL above
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
TODO: At some point, move this somewhere that is appropriate
|
||||
|
||||
# Make sure role has CREATEDB
|
||||
ALTER ROLE username_that_needs_permission CREATEDB;
|
||||
|
||||
# Install migrations
|
||||
cargo install sqlx-cli
|
||||
|
||||
# Make sure to populate DATABASE_URL with correct value.
|
||||
# By default, the DATABASE_URL found in .env file will be used
|
||||
export DATABASE_URL="postgres://icarus_op_test:password@localhost/icarus_auth_test"
|
||||
|
||||
# init
|
||||
sqlx migrate add init_migration
|
||||
sqlx migrate run
|
||||
|
||||
# Create
|
||||
sqlx database create
|
||||
|
||||
# Drop
|
||||
sqlx database drop
|
||||
|
||||
# setup
|
||||
sqlx database setup
|
||||
|
||||
# Reset
|
||||
sqlx database reset
|
||||
Reference in New Issue
Block a user